Today we did a photoshoot again. (Arja needed some pictures again). Nice to have some practice again. I’ve been setting up a little studio in our shed. i’ve got a nice interchangeable background with multiple colors/fabrics. (White/Black/Chromagreen/Blue cloth) I also installed the semi professional lights below.
Nice lightweight stands, with a lightbox, and a remote trigger system. It has two modes. Flash and permanent lighting. It’s a nice piece of equipment, don’t get me wrong. But lately i’ve been using this!
These are led panels, meant for installing in suspended ceilings. I’ve got these from a friend.
BackdropPower supply in front of panel
I like these because they are white, and the other one a little yellow. And produce a lot of light! Unlike the permanent lighting mode of the FalconEyes. (When using the permanent lighting mode you see what the lighting wil be. Unlike using a flash. (Which is also great, when going for other photographs)
When using a reflector like below, you can see the effect instantly.
We used the golden part to get a little warmth into the pictures.
I’m using my big painting-easel to hold the led panels. I just placed the picture holder upside down.
Those led panels are cheap, and you can get them in 3000k,4000k and 6000k (Kelvin) those three i’ve seen in online shops doing a quick search.
First tests with a Vuze Xr. (unedited unoptimized)
It can record 360 movies or take 360 degrees pictures. Besides that it can do stereoscopic recording for using in VR glasses. (2D 180 tested in a oculus vr set) In the past i made those 360 degrees pictures manually using Hugin for example. Also stereoscopic images, using two pictures. But it was a lot of work, and most of the times the quality wasn’t worth it.
I got my DIY timelapse slider out of storage, and notished it wasn’t working any more. I’t was a quick and dirty build, using minimal components and could be build with minimal effort. We could not take a lot of stuff with us to New Zealand. Camera and powerbanks, those we always take with us. So i only needed:
Raspberry Pi
Steppermotor and a plastic sheet where it was mounted on (using tiewraps you can undo)
Timingbeld
Two metal feet it was mounted on
It had to be build strong enough to hold a Nikon 750, and didn’t get out of balance when moving the camera on two metal tubes i bought in NZ.
The RPI would not start anymore, just a red power smd led. SO it didn’t boot. Taking the mini sdcard out of the raspberry trying to put it in my cardreader .. note the trying part. The damn thing broke into two parts, never seen anything like it. Damn, did i backup the latest version? No, i used my mobile and wifi in NZ to modify the scripts. Well .. “We can rebuild him, we have the technology”
How does it work?
Stepper motors move my camera over two metal rods, with ball bearing wheels. The raspberry controls my nikon using a usb cable. Mounted on the raspberry is a steppermotor hat (adafruit) which can control DC motors and stepper motors. ( In this project i used only one stepper ) The stepper motor carries the platform containing itself, a raspberry and my nikon over the “rails” Two switches on each side sends a signal to the program to stop. All timing are set via the Webgui.
Steps
At reboot, python script wil be started
Moving platform to the left, until switch detects the edge
Waiting for in structions
Entering for example timer 30, speed 10 and r
Platform wil move distance 10 to the right
Wait 30 seconds
Grab a picture
And loops until end of rod reached, then it wil move to left again.
Notes:
Gphoto works with other camera’s also
When placing the camera on the platform, focus once. Disable autofocus, also put your camera in manual mode, setting Apeture, ISO and shutterspeed same as your test photo. (bear in mind: when doing sundown shots maybe start with a little light over compensation)
Below old 2018 version
At home testingVersion i can take appartDrinking beer in NewZealand
New Sdcard. Format, put lite on this
# install gphoto2
apt-get install photo2
# connect nikon with usb, capture test with
gphoto2 --capture-image-and-download --interval 5
# Next steppers
apt-get install python3-pip
pip3 install adafruit-circuitpython-motorkit
# enable I2C
raspi-config -> enable i2c
reboot
# Test python script
import time
import board
from adafruit_motorkit import MotorKit
kit = MotorKit(i2c=board.I2C())
for i in range(100):
kit.stepper1.onestep()
time.sleep(0.01)
# Create a API
apt-get install python3-flask python3-flaskext.wtf
I’m using my phone in Hotspot mode, Timelapser will connect to my phone. Open a browser and enter : http://<ip of timelapser>:8080/form
timer in seconds to shoot pictures speed is the movement on the rail go = r(ight) or l(eft) go + timer 0, move until you reach the end (switch detect)
Todo: Need to change CSS to mobile responsive gui .. like my quizzer
import time
import subprocess
from flask import Flask, jsonify
from multiprocessing import Process, Value
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField, TextAreaField
from wtforms.validators import DataRequired
from flask import Flask, render_template, request
from flask import render_template
import board
from adafruit_motor import stepper
from adafruit_motorkit import MotorKit
import RPi.GPIO as GPIO
import os; myenv = os.environ.copy(); myenv["LANG"] = "C"
# NOTE:
# timer = seconds between shots
# speed = distance stepper travel
# Using gpio pins to detect max left/right with switches
# BCM Numbering
GPIO.setmode(GPIO.BCM)
# pullup to 17 & 18
GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# Stepper HAT is i2c
kit = MotorKit(i2c=board.I2C())
kit.stepper1.release()
global timer
global speed
timer=0
speed=0
go="nix"
app = Flask(__name__)
app.config['SECRET_KEY'] = 'you-will-never-guess'
class FormForm(FlaskForm):
timer = StringField('timer', validators=[DataRequired()])
speed = StringField('speed', validators=[DataRequired()])
go = StringField('go', validators=[DataRequired()])
submit = SubmitField('Send control')
# Make below in something like : nikon record .. slowly 10s to the right and recording stop?
# Or bounch left/right using gpio sensors
@app.route("/control/<time>/<speed>")
def action(number, message):
time.sleep(1)
# Print form on: http://<IP>:8080/form = start page
@app.route("/form")
def form():
form = FormForm()
return render_template('web.html', title='Web slide control', form=form)
# process form
@app.route('/data', methods = ['POST', 'GET'])
def data():
if request.method == 'GET':
return "The URL /data is accessed directly. Try going to '/form' to submit form"
if request.method == 'POST':
timer = request.form['timer']
speed = request.form['speed']
go = request.form['go']
timer = int(timer)
speed = int(speed)
if timer == 0:
print("Turn off")
p = Process(target=record_loop, args=(False,speed,timer,go))
p.start()
if str(go) == "l":
while GPIO.input(17) == True:
kit.stepper1.onestep(direction=stepper.FORWARD)
time.sleep(0.01)
if str(go) == "r":
while GPIO.input(18) == True:
kit.stepper1.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)
time.sleep(0.01)
else:
print("Turn on")
p = Process(target=record_loop, args=(True,speed,timer,go))
p.start()
# print form again
form = FormForm()
return render_template('web.html', title='Web slide control', form=form)
# main loop, controls stepper and camera
def record_loop(loop_on,myspeed,mytimer,mygo):
while True:
if loop_on == True:
# test if switch hit yet, else move
print('timer' + str(mytimer))
print('speed' + str(myspeed))
time.sleep(2)
if str(mygo) == "l":
if GPIO.input(17):
print("Pin 17 is HIGH")
for i in range(myspeed):
kit.stepper1.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)
time.sleep(0.01)
kit.stepper1.release()
else:
print("Pin 17 is LOW")
if str(mygo) == "r":
if GPIO.input(18):
print("Pin 18 is HIGH")
for i in range(myspeed):
kit.stepper1.onestep(direction=stepper.BACKWARD, style=stepper.DOUBLE)
time.sleep(0.01)
kit.stepper1.release()
else:
print("Pin 18 is LOW")
time.sleep(mytimer)
subprocess.run(['/root/mycapture'])
subprocess.Popen([
"gphoto2",
"--capture-image"],stdout=subprocess.PIPE)
# Main loop
if __name__ == "__main__":
while GPIO.input(17) == True:
kit.stepper1.onestep(direction=stepper.FORWARD, style=stepper.DOUBLE)
time.sleep(0.01)
kit.stepper1.release()
p = Process(target=record_loop, args=(False,0,0,go))
p.start()
app.run(host='0.0.0.0', port=8080, debug=False)
p.join()
Other files
cat templates/web.html
{% block content %}
<h1>Slide control</h1>
<form action="/data" method = "POST">
{{ form.hidden_tag() }}
<p>
{{ form.timer.label }}<br>
{{ form.timer(size=32) }}
</p>
<p>
{{ form.speed.label }}<br>
{{ form.speed(size=32) }}
</p>
<p>
{{ form.speed.go }}<br>
{{ form.go(size=32) }}
</p>
<p>{{ form.submit() }}</p>
</form>
{% endblock %}
gphoto running from cron/python is a b*tch, had to rewrite subprocess and running from screen
Start screen @reboot, just crontab -e
A few years ago i wrote a photo manager .. again .. ( see post about my first previous photo manager ) It is a web gui to find photos in my huge photo archive. I manually added 190k tags to 120k photos in 20+ years.
I thought wouldn’t it be nice if i can generate additional metadata using Machine Learning. A few years ago i did some testing and followed a podcast and free course about machine learning.
So today i started to implement a addition to my gui. Machine recognition tags!
It already kinda works.
Things to do :
Make it a background job, my fileserver doesn’t run Tensorflow on a GPU, so it is slooow
Embed in existing GUI and stats
Design a editor to remove wrong tags
Below a part of ML images
Command to get a thumbnail sheet with only directory names:
I made two scripts, which take a movie, find out its lenght divide by 9. And generates a image montage of snapshots at certain times in the movie. ( A movie of 90 minutes, gets a snapshot every 10 minutes )
Example of snapshots of a movie
Below takes images as above and convert them into animated gifs. All movies in a path or directory structure gets a index page containing all animated gifs.
Example of generated directory index
I’ll post something about my media sorter also. A ajax website using drag drop viewing/sorting images (png/gifs/jpgs) and movies.
I made a little script to make a 360 spherical panorama photo, using a remote controlled IP cam,
Looking at the API CGI, i only needed to control the movement of the camera and getting a snapshot.
Point camera down
Point camera maximal left
Take picture
Point a little to the right
Take picture, loop until max right
Point a little more up and go max left
Doing same loop as above, until pointing maximal up
Made a little animation in blender
After getting all those pictures, i only needed to stitch them using Hugin. When viewing the image with VR Glasses, i could look around my room, without image distortion, like below flattend example.
The ipcam generates a token, which you have to use in your curl commands.
Started to play in a pipeband myself when i was 14, so it made some impression alright!
(Short version)
Sometimes i have to be a little creative .. 8mm from the 70s are not always the correct width (snipping the 8mm into two parts while producing), so it get’s stuck. This helps
Changed some code controlling my wacom drawing tablet. I use this one to draw Art, diagrams and touch up photo’s.
When using multiple screens, i had the problem it would stretch the draw area over multiple screens, streching the ratio. Or it took the work screen to work on.
#!/bin/bash
# using xinput here, check post about two mouses/keyboards on one machine
# Use xrandr to check names check
MONITOR="DP-1"
PAD_NAME='Wacom BambooFun 6x8 Pad pad'
#undo
xsetwacom --set "$PAD_NAME" Button 1 "key +ctrl +z -z -ctrl"
xsetwacom --set "$PAD_NAME" Button 2 "key e"
xsetwacom --set "$PAD_NAME" Button 3 "key h"
ID_STYLUS=`xinput | grep "Pen stylus" | cut -f 2 | cut -c 4-5`
xinput map-to-output $ID_STYLUS $MONITOR
ID_STYLUS_2=`xinput | grep "Pen eraser" | cut -f 2 | cut -c 4-5`
xinput map-to-output $ID_STYLUS_2 $MONITOR
exit 0
Most of the times i use Krita and Gimp.
"If something is worth doing, it's worth overdoing."