04-30-2020 04:14 PM
I am doing a school project on image correction. Previously we corrected image motion by taking a video file, extracting a single frame and using that frame as a template where i could drag and select the object and obtain its coordinates. Now in a different function each frame of the video was extracted and the object along with its coordinates where found. The coordinates of the template image then had coordinates of said object in each particular frame subtracted from it. This is accomplished using for loops and then saved into a new video file. This code completely works, might not be the best way but it works.
Now i am trying to do nearly the exact same thing expect i take a picture with a camera and use that as my template image instead of extracting a single frame (this part of the code works). Instead of a video file i have a live feed from my webcam. I have the template working but i am unable to extract a frame from my webcam to have it go through my motion correction function.
i am unable to get an image from IMAQdx Get Image VI and place it into either
IMAQ ExtractSingleColorPlane VI, IMAQ Match Pattern 2 VI to be corrected. I placed everything in a while loop and at either ExtractSingleColorPLane or pattern match i get an invalid image.
The purpose is to have a corrected live feed of my webcam at the end.
Any help would be greatly appreciated on this issue. Thank you
05-01-2020 03:55 AM
05-01-2020 03:06 PM
Sorry here is a picture of my problem, i am terrible at this.
05-01-2020 07:11 PM
Attach your VI. A blurry picture that we can't inspect, edit, test hampers our ability to help. Do you have the LabVIEW Vision Development Module and Vision Acquisition Software installed?
Bob Schor
05-01-2020 07:25 PM - edited 05-01-2020 07:36 PM
Sorry and i have vision development module 2019 installed. However i am unsure about the Vision acquisition software. I am unsure about the big while loop around the nested for loops. i was trying random things to get it to work.
05-02-2020 09:00 AM
@Mitch899 wrote:
Sorry and i have vision development module 2019 installed.
You need Vision Acquisition Software (VAS) to "acquire" images from a camera. Since you are using a WebCam, you will need IMAQdx. When you open the Vision and Motion Palette on the Block Diagram, do you see a sub-Palette called IMAQdx? If you open NI-MAX and expand the Software tab, do you see IMAQ and IMAQdx (with a camera icon) listed, about half-way down? If you open the NI License Manager, do you see an entry for Vision Acquisition Software?
If the answer to any of these (and especially if to all of these) is "No", then you are missing the Vision Acquisition Software and will not be able to acquire Images from a Camera using LabVIEW.
Bob Schor
05-02-2020 01:10 PM
Yes i have Vision Acquisition software 19.5, NI-IMAQ, and NI-IMAQdx.
05-02-2020 04:58 PM
OK. Then you should be able to get images from a WebCam (or your PC's Camera).
Do you have an Image? Then your camera is working and you should be able to acquire images with LabVIEW.
Bob Schor
05-02-2020 11:33 PM
Thank you. My issue is not necessary getting a video feed from the camera. But trying to put the video feed through my image correction function and receiving a video feed out at the end. (the video feed out the end probably has issues to)
The way i did this previously was reading each frame from a video file and placing it through my function and then writing each corrected frame to a new video file.
However with a live feed from camera i cannot get a valid image to place into IMAQ ExtractSingleColorPlane VI.
I was trying to use IMAQ AVI2 Read Frame VI (as i did reading frames from a pre-made video file in my last project) but trying to get some sort of frame out of the live feed from the camera is what has me stumped. I keep getting an invalid image error.
I suspect there is something i may not understanding about the live freed from the camera.
05-03-2020 08:01 AM
OK, I confess that I didn't look at your code in my earlier replies, as it sounded like Image Acquisition was the problem. Now I have looked, and it looks strange, as though you "draw the box" not around the actual Image but around a more-or-less blank Image.
I haven't done Image isolation for a few years, so I'll have to dig into my old code and see if I can come up with some general principles for you to try. Stay tuned ...
Bob Schor