01-07-2014 04:33 PM
Hi, I am trying to use the multiple IMAQ extract functions to get certain parts of the webcam image and then using the color extract function to get the average RGB values. The problem is that both the IMAQ extract functions give the same image on its output port. The block diagram snippet and VI are attached below. Also, please let me know if there is a better way of doing this. I need to expand this later to extract rgb values of about 40-50 different parts of the image instead of just two shown below.
Solved! Go to Solution.
01-07-2014 04:42 PM
This happened because IMAQ Images transferred by references. You should provide different destination images for each extraction:
Andrey.
01-07-2014 04:43 PM
You did not create another image that you should wire to the input "Image Dst" of "IMAQ Extract". That's why you always operate on the original image (which you should not do if you intend to operate on several regions of the image).
Solution:
(1) Create a new image and wire this to "Image Dst".
(2) Apply the histogram operation sequentially (e.g. in a loop).
That way you will notice, that Image Dst contains actually(!) the region you have specified. (Put a probe on the image wire that goes from the Extract VI to the Histogram VI).
01-07-2014 07:17 PM
Thanks, that solved it. if you don't mind, I have another question/issue. I am getting only about 10fps but the webcam is capable of 30fps. Only a couple times, I saw it display about 29 fps, but for the most part, its staying a little below 10fps. Do you know why it is so slow?
01-07-2014 07:42 PM
Nevermind, just had to change some camera settings from auto to manual.