Closed reemastha706 closed 6 months ago
I found a solution for my problem from one of the other post. Thanks :)
Hi, that's great to hear. Can you link the solution, in case others find this issue and have a similar application?
I just did a slight modification on Niklas's code https://github.com/alliedvision/VimbaPython/issues/62 instead of write_image() `def stack(img_arr, frame): img_arr += frame return img_arr
def maxvalue(frame_queue: queue.Queue):
while True:
img_arr = np.zeros((1024, 1280, 1))
pause = 1 #in sec
start_time = time.time()
count = 0
while time.time() - start_time < pause:
frame, id = frame_queue.get()
img_arr = stack(img_arr, frame.astype(float))
count += 1
print(f'Max value: {np.round(np.max(img_arr)/count, 2)}') #count give the number of frames prcoessed
frame_queue.task_done()
`
and changed the for loop in record image with while loop. Even though, i couldn't do much about user input stopping of camera but Ctrl+C (keyboard interruption, works fine for now.
Hi, I am want to do image acquisition to get the maximum intensity value at certain time. This loop needs to run infinitely until the user wants to terminate the loop. my algorithm is as follow:
This is my code:
But this is not running properly. either the code crashes or the value it reads is wrong. How do I solve this problem?