Any quick tutorials on simple commands?

59 views
Skip to first unread message

Ruben Kertesz

unread,
Jan 31, 2015, 8:25:47 AM1/31/15
to open...@googlegroups.com
Now that I can communicate with my OpenMV (yes!), I would like to use it for some simple scenarios. Are there any tutorials that can help me program up the following or give me enough understanding to code this?

Running on battery power;
1) wake up every 10 min, capture a photo to SD, go to sleep
2) like 1 but take a movie clip (30 frames)
3) when power is turned on to openMV, take a photo to SD and then send a message to a master device (eg simple pin high or i2c message) telling the master to cut power to the OpenMV unit.
4) like 3 but a movie clip.

Later I would like to get into more complicated stuff like: passing the image data to a master device via SPI or I2C, line detection, object size detection, cropping, and color identification and color removal from images or video. However, I am still on the basics.

Pat Ryan

unread,
Feb 1, 2015, 8:49:02 AM2/1/15
to open...@googlegroups.com
I'm with Ruben on this. I could really use some examples. I want to do oculus rift barrel distortion, high resolution camera mode, output USB profile (mouse, joystick, keyboard, etc.) without need for extra arduino, optical flow, etc.

Ibrahim Abdelkader

unread,
Feb 1, 2015, 1:27:03 PM2/1/15
to open...@googlegroups.com
There are no tutorials *yet* sorry, mainly because the API might change, but what you want to do is easy enough to figure out from the examples.

Erik B Beall

unread,
Feb 2, 2015, 11:22:12 PM2/2/15
to open...@googlegroups.com
Just a quick one for the first two, this might work:

import sensor, time
# script to take a snapshot to the SD card every 10 minutes
# images stored as snap_<num>.ppm, where num increments from 1
sensor.reset()
sensor.set_contrast(1)
sensor.set_gainceiling(16)

# Set sensor pixel format
sensor.set_framesize(sensor.QVGA)
sensor.set_pixformat(sensor.JPEG)
sensor.set_quality(98)

print ('Entering loop')
picnum=1
clock = time.clock()
while (True):
  # sleep for 10 minutes = 1000msec * 60 sec * 10 min
  time.sleep(1000*60*10)
  clock.tick()
  fname='/snap_'+str(picnum)+'.ppm'
  image=sensor.snapshot()
  image.save(fname)
  picnum=picnum+1


And for the second, you could run sensor.snapshot() in a loop 30x (note saving each file to disk will reduce fps). For the others, you can import gpio and then toggle gpio using notifypin = gpio.GPIO(gpio.P2) and then notifypin.low() or notifypin.high() in your code.
Reply all
Reply to author
Forward
0 new messages