# Capture Images using the OAK Camera

**URL:** <https://discourse.farm-ng.com/t/capture-images-using-the-oak-camera/169>\
**Category:** general\
**Created:** [April 17, 2023, 6:57pm UTC](https://discourse.farm-ng.com/t/capture-images-using-the-oak-camera/169 "2023-04-17T18:57:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amlan\_Balabantaray](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.farm-ng.com/amlan_balabantaray/32/110_2.png) [@Amlan\_Balabantaray](https://discourse.farm-ng.com/u/Amlan_Balabantaray)\
**Post date:** [April 17, 2023, 6:57pm UTC](https://discourse.farm-ng.com/t/capture-images-using-the-oak-camera/169/1 "2023-04-17T18:57:27Z")

</div>

Hello Team,

We want to capture few images using the OAK Camera on the Amiga. Is there any instruction on how should we proceed?

Regards,  
Amlan

---

<div class="post-metadata">

**Author:** ![Jerrycowell96](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.farm-ng.com/jerrycowell96/32/71_2.png) [@Jerrycowell96](https://discourse.farm-ng.com/u/Jerrycowell96)\
**Post date:** [April 17, 2023, 7:49pm UTC](https://discourse.farm-ng.com/t/capture-images-using-the-oak-camera/169/2 "2023-04-17T19:49:46Z")

</div>

Were you wanting to just take photo from the Amiga using the camera or just use the camera by itself to take photos perhaps using a computer or some other device through the PoE Switch?

---

<div class="post-metadata">

**Author:** ![Amlan\_Balabantaray](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.farm-ng.com/amlan_balabantaray/32/110_2.png) [@Amlan\_Balabantaray](https://discourse.farm-ng.com/u/Amlan_Balabantaray)\
**Post date:** [April 17, 2023, 9:28pm UTC](https://discourse.farm-ng.com/t/capture-images-using-the-oak-camera/169/3 "2023-04-17T21:28:49Z")

</div>

We want the Amiga to capture pictures automatically after a certain time interval while it is moving. Do you have any instructions for that?

---

<div class="post-metadata">

**Author:** ![kylecoble](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.farm-ng.com/kylecoble/32/12_2.png) [@kylecoble](https://discourse.farm-ng.com/u/kylecoble)\
**Post date:** [April 18, 2023, 2:39pm UTC](https://discourse.farm-ng.com/t/capture-images-using-the-oak-camera/169/4 "2023-04-18T14:39:56Z")

</div>

Hello Amlan,

We do not have instructions for this published, but this should be a fun small project for you! There are a number of ways you can do this. What I would recommend is the following:

1. Create a custom app using the app template

2. Base your app entirely off of the camera-streamer

3. Add `opencv-python` as a dependency in `setup.cfg`

4. Add a kivy `ToggleButton` in the main.kv file. This will be used to enable / disable the image capture timer.

5. Use `time.monotonic()` timestamps for your timer.

6. Create a folder in your python code named something like `~/my_data/` (this = `/data/home/amiga/my_data`) for writing images to

7. Use `cv2.imwrite()` to write images to the folder if the ToggleButton state is `'down'` and the timer has hit the threshold to capture the next image in the `stream_camera` method.

8. **After** capturing data when the Amiga is back connected to the same network as your development station is connected to, use `scp` command line tool to transfer the files to your computer

9. **After** transferring the files (and recommended saving a backup somewhere) you can delete the files in `~/my_data` off the Amiga if you start running low on available disk space (seen in the lower right hand corner on the Brain home page)

These are just recommendations, so feel free to put your own twist on it. I also may have omitted a few implementation details, but the key concepts should be here.

If you’d like to make an open source app for this (by making your repository created based on the app-template public), I’d be happy to collaborate with you!

– Kyle
