samuelpowell / Spinnaker.jl

A Julia interface to the FLIR/PointGrey Spinnaker SDK
MIT License
15 stars 7 forks source link

Added framerate!(), timestamp() and id() #4

Closed IanButterworth closed 5 years ago

IanButterworth commented 5 years ago

framerate! and timestamp explained in readme, however id() is returning 0, so omitted.

framerate!(cam,60)
60.0

timestamp(image)
2166531583413

id(image)
0
IanButterworth commented 5 years ago

Example usage, where framerate is purposely set above max to achieve maximum

using Spinnaker, PyPlot, Statistics

function testrun(cam,caps;plotjitter=false)
    start!(cam)
    times = Array{Int64}(undef,caps)
    for i=1:caps
        image = getimage(cam)
        times[i] = timestamp(image)
    end
    stop!(cam)
    framerates = 1e9./(times[2:end]-times[1:end-1])
    plot(1:caps-1,framerates);ylabel("Framerate (fps)");xlabel("Framenum");
end

camlist = CameraList()
cam = camlist[0]
exposure!(cam,0.1e6)
pixelformat!(cam, "Mono8")

framerate!(cam,124)
121.21212005615234

testrun(cam,100,plotjitter=true)

image

samuelpowell commented 5 years ago

LGTM, cheers!