« first day (6 days earlier)      last day (54 days later) » 

7:31 PM
@A_A what happened are you busy? Is been almost 24 hours so wondering whethrr you got a chance to see what I have posted...
 
A_A
7:53 PM
@TanMath I was just having a browse
@TanMath What is the webcam on the raspberry pi?
 
@A_A these tests were not on the raspberry pi
They were still on my computer
@A_A But next week I will try on the Raspberry Pi Camera V2, as well the OpenMV M7 connected to my computer...
(I am out of town and didn't bring the hardware with me so unfortunately cannot test it now on the RPi... sorry... But I still have my computer webcam of course)
 
A_A
@TanMath The Pi Camera might be a bit more sensitive.
 
@A_A :( unfortunately, i didn't bring it with me... what should else should I do?
 
A_A
@TanMath Are you taking the frame timestamp into account now?
 
8:09 PM
@A_A nope you hadn't asked me to do that yet... shall I do that then?
 
A_A
@TanMath I am not directing you btw :)
@TanMath I think that you should. As you noticed as well, the temporal signal is affected a great deal.
 
@A_A well I figured I should listen to you instead of posting plots here and you not wanting them and being confused
@A_A ok... What other things could lead to the 50bpm frequency?
 
A_A
@TanMath Do you think you could capture a few minutes and share a CSV file with: Timestamp, R, G, B
 
@A_A sure... But with what conditions?
 
A_A
@TanMath If possible, can you use the periodic gif? Occupying the full view of the camera
 
8:25 PM
@A_A Sure... The face one, right? I think I had saved it actually, so will convert it to csv and send it to you...
 
A_A
@TanMath Does it have the frame timestamp?
 
@A_A yep..
 
A_A
@TanMath When you plot the waveforms do you take the timestamp into account?
 
@A_A what do you mean?
the plots are done as follows:
plt.plot(time,R)
plt.plot(time,G)
plt.plot(time,B)
 
A_A
@TanMath Ah, so time is precomputed or the frame timestamp?
 
8:32 PM
@A_A no it is the timestamp... right after each frame is retrieved, the timestamp is taken using the datetime module
@A_A but the timestamp is only used for plotting... I do not use it for anything else though...
 
A_A
@TanMath Now I am confused again
 
@A_A before it was used for calculating the period T, and therefore the frame rate, from the time at the start and end of the sliding window... but then you told me to just assume T=1/30, and therefore Fs = 30 fps
yesterday, by TanMath
@A_A so like before I had taken the time measured at the 1st frame and the last frame of the sliding window to calculate the sampling rate... i am asking whether to keep that or to assume Fs = 30 fps
yesterday, by A_A
@TanMath Let's assume 30 FPS for the moment. It doesn't really matter. What you expect to see is a strong periodic component that correlates with the heart bpm
 
A_A
@TanMath The low level functions that capture input from the web cam return a long int that is the timestamp
 
@A_A wait is this a question?
 
A_A
@TanMath So, basically you grab input frame by frame ?
 
8:36 PM
@A_A yeah...
@A_A lemme post the relevant code...
 
A_A
@TanMath Then you DEFINITELY need to take the timestamp into account
@TanMath This way of capturing "video" is hugely unreliable in terms of frame rate
 
while cap.isOpened():
    ret, frame = cap.read() # read in the frame, status
    if ret == True: # if status is true
        frame_num += 1 # count frame
        if firstFrame is None:
            start = datetime.datetime.now() # start time
            time.append(0)
            ...
        else:
           current = datetime.datetime.now()-start # time for the current frame
           current = current.total_seconds()
           time.append(current)
@A_A ^ how the frames are acquired and the timestamp...
 
A_A
@TanMath I see
@TanMath ok, this explains a few things.
 
@A_A and so is this a bad way of doing it? if so, is there an alternative method of acquiring frames... or how would I compensate with the timestamp?
@A_A lol do you want the whole code? without the comments, it's definitely less than 100 lines (maybe be 60-70 lines)...
 
A_A
@TanMath With interpolation as we said before. So basically, you acquire a frame, and in the frame code you also do all the computations for the heart rate?
 
8:43 PM
@A_A yeah... It was meant to be a real-time system so I assumed that is the only way to do it real time
 
A_A
@TanMath That's not real time :) While you calculate the BPM you are not acquiring any more frames.
@TanMath Can you please use some generic piece of software and record a video of a real face and then use that archive as input to your system?
 
@A_A well as real time as I can get :P after all it is probably impossible to get it fully real time!
@A_A but do I need time stamps?
 
A_A
@TanMath Yes, definitely
 
9:00 PM
@A_A ok and do you still want the periodic gif csv?
 
A_A
@TanMath Yes please, if you can use something like paste in (?)
 
@A_A oh ok so not csv but some online pastebin? That actually probably makes it easier for me lol
 
A_A
@TanMath Yeah, a text CSV on paste in is quickest
 
A_A
First is the time second is brightness?
 
9:07 PM
@A_A sorry, the first one is the time, second one the R values, third one B values, last one G values (sorry it didn't let me post G first for some reason)..
@A_A Is the format fine?
 
A_A
@TanMath Yes, no problem, thanks. I will have a look and get back to you about it
 
@A_A ok thanks... So you want me to take a video with timestamps, of my regular face (not gif) without normalization and bandpass with regular RGB (not avg intensity)... Correct? And what are we expecting from that?
 
A_A
@TanMath The video will preserve the frame rate better. Much less jitter
 
@A_A ok and post the temporary signal plots, and fft?
 
A_A
@TanMath Yes please.
 
9:18 PM
@A_A ok.. unfortunately, I can only get it to you in another couple hours so you Will probably see it tomorrow,.
@A_A but thanks so much for the help ... appreciate it... and talk to you soon!
 
A_A
@TanMath Yeah, will have more tomorrow too I believe
 
@A_A ok thanks! Good night! (Day for me still :P)
 
A_A
@TanMath No worries, have a good time
 

« first day (6 days earlier)      last day (54 days later) »