10-31-2021 09:41 PM
Hi,
Currently, I am using imadxGetImageData to get 4 frame(2048*512) data at one time, then do the FFT and other transformations for the each 2048 pixels. It is very slow in one thread and the frame rate is only like 0.5 fps or so.
I am considering using multithreading to accelerate it by building 5 threads. One thread is for get image data of 4 frame at one time(only take about 20ms). After receiving the 4 frame data, I want to use 4 threads to process each frame. After the processing and displaying, then again to get the 4 frame raw data, so does with this loop.
I read the some post and official documentations, trying to understand the official examples of multithreading, but it is kind of complicated and difficult. I kind of know maybe I need to use thread safe queue and thread lock to do it, but the whole documentation is a little long.
So I am wondering if anyone can help to understand it? Thank you for your help.
10-31-2021 10:25 PM
You will get better reach by posting under LabWindows group instead of LabVIEW
https://forums.ni.com/t5/LabWindows-CVI/bd-p/180
11-02-2021
04:09 AM
- last edited on
03-28-2025
09:11 AM
by
Content Cleaner
Hello, unfortunately multithreading is not an easy-as-pie paradigm: we can give you some basic hint, but a good amount of study and some trial and error will be needed before you can consider yourself familiar with it.
The situation you are describing seems to be well serviced by a producer-consumer architecture, with the image acquisition being the producer part and image processing the consumer one. You can read some fundamentals on this paradigm here and here. None of these links are directly aimed to CVI, but you can take the concepts exposed in each of them getting rid of the details specific to LabVIEW and other stuff. Specific information on multithreading in CVI can be found in Creating Applications >> Creating Multithreaded Applications chapter in the help
So you''ll have:
11-02-2021 04:23 PM
Hi Roberto,
Thank you for taking time to reply. Your information is very useful and I will go through the posts you shared. Thank you again for your help.