07-22-2008 03:45 PM
07-23-2008 12:56 PM
Hey German Coast Guard,
You mention that you calibrated your camera according to the steps in the NI Vision Assistant… did you set-up a calibration step for the image in Vision Assistant? Image Calibration allows the software to relate pixels in the image to real-world units, and permits the usage of the Convert Pixel to Real World VI in LabVIEW.
Chapter 3 of the NI Vision Concepts manual covers calibration setup in depth. The manual can be found in Windows XP at Start-> Programs-> National Instruments-> Vision Assistant X.X-> NI Vision Concepts Manual.
If you have an Image Calibration step in your Vision Assistant configuration and you are sure it’s configured properly yet you continue to receive this error, please post your Vision Assistant script (.scr file) and LabVIEW VI to this forum for everyone to troubleshoot. Thanks!
07-23-2008 03:47 PM
Hi DjDave,
Thanks for liking my name, haha. To help clarify what my code does, here is a brief explanation of my project:
The set of VIs I wrote are meant to correct a robot's physical state (determined by GPS, etc.) when my camera observes a white line. My robot operates in an area outlined by white lines, which are initially defined for the robot by a set of real world, a priori coordinates related to physical state. When the robot sees a white line, it calculates observed distance between itself and the white line and subtracts this from the distance the physical state thinks it is away from the a priori line, thereby giving a physical state correction.
I am processing the camera image by extracting the white line as a binary image then converting this to real world coordinates, and fitting a line through these points, which I use for my robot's calculation of how far away it is from the observed line.
Attached is the set of VIs that I wrote for this application. Unfortunately, the file that splits the camera stream into individual jpegs is integrated with other VIs and I am unable to extract it at this point to make the splitter standalone. The other thing I am not able to include is the information contained in the cluster throughout my VIs. This cluster is for my robot's physical state information, including orientation, (x,y) location, etc.
As I said in a previous post, however, once the entire project stops executing and I rerun just the VIs I wrote with the static image still retained in the wire values, I do not encounter an error, so I am wondering if you will even get an error when you try to run this.
(I apologize if my code is somewhat disjointed and all over the place, since I am very new to LabVIEW.)
Attached are both the VIs (including the Vision Assistant, auto-generated one) as well as the calibration png and .scr file you requested.
Thanks for all of your help!
German Coast Guard
07-24-2008 06:41 PM
Hey German Coast Guard,
Check out the modified Vision Assistant file I’ve attached. You cannot use the “Extract RGB…” function on a binary image, since this function only works with RGB (32 bit), HSL, and RGB (64 bit) images. I removed this block from your .SCR file, and was able to run the steps without problems. I was also able to generate functional LabVIEW code from this .SCR file. If you base your VI’s on my .SCR, you will no longer receive the error you mentioned above. I hope this helps 🙂
07-25-2008 09:32 AM
Hi Dave,
Thank you for your continued help. I attempted to run your scr file, but am unable to do it with the images I am capturing from the camera, because I receive a 32-bit rgb image, which requires me to do a color plane extraction. (A blue color plane extraction also makes the white line on the grass stand out really really nicely.)
I think that there may have been a misunderstanding with the image I posted. The calibration png file is what I used in order to determine how pixels translate to real world coordinates. I am attaching a sample picture I have captured from the camera, a white line on grass.
Again, thanks for taking the time to help me,
German Coast Guard
07-28-2008 06:28 PM
Hello German Coast Guard,
I used your .SCR file to generate functional LabVIEW code and I was able to perform the analysis on the image you posted. Which of the posted VI’s demonstrates the issue? At what point exactly do you encounter this error or any problems? An easy way to check in LabVIEW is to use highlight execution feature to observe where the error comes from. I hope this helps 🙂
07-28-2008 09:51 PM
Hi Dave,
Thank you for getting back to me. As stated in a previous message, the error actually only occurs when I am utilizing the image capture program VI that was previously written for another project (which however, has been tested and works independently as well). Otherwise the VI executes as it should (i.e. when loading a static image from file and running the series of VIs). (I can post a screenshot of the capture VI tomorrow morning.) Upon doing a "highlighted execution," I noticed that when the error occurs, it first occurs at the extract blue plane VI block, and then propagates until the end, where it finally breaks the program. Unfortunately I am unable to execute the VIs at this time, since I am not at work, but will run the code first thing tomorrow morning and post the error code that I receive.
Thank you for your time,
German Coast Guard
07-29-2008 10:16 AM
Dear Dave,
Attached is a screenshot of the two VIs that are responsible for passing images to my Fit Line VIs.
The VI in the top right corner is the "Playback Timestamp Scroll" VI, which is responsible for loading and passing a sequence of JPEGS to the camera master. As can be seen in the camera master window, this image is then passed to the Fit Line VI, located in the diagram disable structure located in the middle of the screenshot. Currently, when I am doing a highlighted execution and playback is enabled, I am no longer receiving an error during the blue plane extraction. The first error I am encountering is occurring at the Convert Pixel to Real World VI, which gives the error message "Error -1074396113 Convert Pixel To Real World During Camera Feed."
Unfortunately the camera master and playback timestamp scroll are integrated with virtually every other VI in the project as well, which makes it difficult for me to extract the applicable files and post the project here on the forum. However, I will see if our resident LabView expert can help me with this when he gets in today.
Thank you for your help,
German Coast Guard
07-30-2008 09:51 AM - edited 07-30-2008 09:59 AM
07-30-2008 08:10 PM
Hey German Coast Guard,
Unfortunately I cannot reproduce your blue color plane extraction error. Could you narrow down the particular VI that demonstrates this issue? I tried to run the VI’s you posted, but there is so much complexity in the code that I cannot get past a shared variable error. Please post only the code that demonstrates the problem. Thanks!