Skip to content

get timestamp of a frame #124

@NejcKozjekKnaufInsulation

Description

I am trying to get a timestamp of a frame, but can't find how. I am running the camera in continuous mode.

Currently I am doing it this way and I don't know if the timestamp I am getting is equal to the real timestamp.

def sv_frame(self, frame):
    img = frame.buffer_data_numpy()
    timestamp = time.time()

I noticed in Vimba there's a command GevTimestampControlLatch and a variable GevTimestampValue which should control the appending timestamp to a frame and storing it into a variable. However I cannot run the aforementioned command and the variable is always 0.

Looking at a source code I have found one reference to timestamp and I was able to acquire it via frame.data.timestamp. Per Vimba documentation I divided the number with the GevTimestampTickFrequency of the oscillator, but I receive a float number that doesn't resemble the timestamp. However the difference in consequent frames do reflect the exposure time of the camera (in my case 3-4 ms).

def sv_frame(self, frame):
    img = frame.buffer_data_numpy()
    timestamp = frame.data.timestamp / self.tick_frequency

Example output:

  1. Timestamp from time.time(): 1588177322.3672035
  2. Timestamp from second approach: 19806.7125729

"1" yields 18:22:2.367203
"2" yields (considering time in seconds): 5:30:6.7125728

How can I get a sensible timestamp from the camera?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions