I'm running Python3 with a camera sensor connected to a rasp pie.
There is a part in the program that I want to execute every time the "frame number" included in the data sent from the camera increases by a certain number.
Loop the whole with while, and every time "frame_number" included in the return value from the camera increases by a certain number (10,000 in this case), create another variable fn to execute the contents of if and branch it I have included it, but I can't do what I wanted.
You can see that f_n = 0 is meaningless when frame_number goes over time from the start, but I can't figure out how to do it.
frame_number does not increase by the same value every time, but it seems to be slightly different (?) depending on the time taken by the last processing etc.Applicable source code
Supplemental information (FW/tool version etc.)
while 1: fn = fn + frame_number if fn/10000>1: (Omitted) #Execute this process fn = 0
Answer # 1
fn = 0 while 1: if (frame_number-fn)/10000>1: (Omitted) #Execute this process fn = frame_number // 10000 * 10000
The above should be executed once when frame_number is 10,000, once when frame_number is 20,000, and so on.
Answer # 2
fn = fn + frame_number
For example, if frame_number is 10 and if the while loop is repeated 10 times, let's consider what value fn will be, and what value should it be?
- python - about image processing of hog method
- parallel processing method in python
- i want to execute processing like imfill in matlab with python
- [python] i want to know the output method
- python - i want to divide the processing by conditional branching for the data frame
- python, csv conversion method (text file not tab-delimited)
- i want to execute file dl processing regularly with cron i couldn't do it on heroku can you do it with sakura rental server?
- i want to execute the docker command from a python process
- i want to execute a string as a script in python and get the result
- python - django formset value method
- python - about the feature selection method
- python - i want to store data in tuples every time i reload and output the latest 5
- python 3x - [natural language processing] i want to include a single punctuation mark when creating a word ngram with count vect
- i want to change the color of the ball every time i break one block with python breakout
- python 3x - [natural language processing] extract only the first layer of part of speech classification with regular expressions
- cannot combine python pdf files (multiple processing using excel list and for statement)
- processing using the len function when an integer value is obtained from python standard input
- python 3x - python3: i want to separate the processing if there is a specific character string in the file
- python - set-executionpolicy method
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- python - you may need to restart the kernel to use updated packages error
- python 3x - typeerror: 'method' object is not subscriptable
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- xcode - pod install [!] no `podfile 'found in the project directory
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
- android studio - unresolved reference comes out in kotlin