Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -1074396113 Convert Pixel To Real World During Camera Feed

Hello,
 
I am reposting this in the Machine Vision section, because I am unsure whether or not this topic would be more appropriate here than in the LabView software board I originally posted.
 
Thank you.
 
Hello,
 
I am fairly new to LabView and am encountering an error that I can't seem to solve.
 
I am utilizing an image feed from a firewire camera to detect the real world location of a white line.  I have modified a tested, existing VI that processes the stream into individual image files, which I then pass to the VIs I wrote.
 
Using the NI Vision Assistant, I created a script that extracts a color plane and processes the image to a binary image, where "off" is blank space and "on" is the line I am trying to find.  I then pass this image onto another VI, where I am encountering the error "Error -1074396113 occurred at IMAQ Convert Pixel To Real World.  The source/input image has not been calibrated" when I attempt to convert the binary image into real world coordinates using the "convert pixel to real world" VI. 
 
I have calibrated my camera per instructions in the NI Vision Assistant.  Strangely, once the program encounters the error and I stop execution of the VI, then re-run just the image processing VIs on the static image still retained in the wire, everything executes properly.
 
I would appreciate any help in this matter,
 
Thank you,
German Coast Guard
0 Kudos
Message 1 of 15
(5,118 Views)

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!

David G
Sales Engineer - SE Michigan & N Ohio
National Instruments
0 Kudos
Message 2 of 15
(5,097 Views)

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

Download All
0 Kudos
Message 3 of 15
(5,090 Views)

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 🙂

David G
Sales Engineer - SE Michigan & N Ohio
National Instruments
Download All
0 Kudos
Message 4 of 15
(5,070 Views)

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

0 Kudos
Message 5 of 15
(5,053 Views)

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 🙂

David G
Sales Engineer - SE Michigan & N Ohio
National Instruments
0 Kudos
Message 6 of 15
(5,020 Views)

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

0 Kudos
Message 7 of 15
(5,011 Views)

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

0 Kudos
Message 8 of 15
(4,997 Views)
Dear Dave,
 
I have finally managed to extract all of the necessary files for you to run the project.
 
Here is a link to a log file and images, which must be unzipped and loaded for playback.
 
Unfortunately, the project is a little cumbersome to execute, so here are some instructions:
 
1.) Open Playback_Playback Timestamp Scroll vi.
2.) Open the CWRU Cutter NRT Master vi.
3.) Open the Camera Master vi.
4.) Run the Timestamp Scroll VI and click on the folder icon.
5.) Navigate to the NRT Master Log.nrt.idx file located in the attached folder.
6.) Click load playback index file and toggle the enable playback switch.  You can then pause and unpause playback with the small switch.
7.) Run the CWRU Cutter NRT Master
8.) Run the Camera Master VI.
9.) If you need to stop the VIs, use the stop buttons on the front panel or everything will break.
 
Thank you very much for your continued help,
German Coast Guard


Message Edited by German Coast Guard on 07-30-2008 09:54 AM

Message Edited by German Coast Guard on 07-30-2008 09:59 AM
0 Kudos
Message 9 of 15
(4,981 Views)

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!

David G
Sales Engineer - SE Michigan & N Ohio
National Instruments
0 Kudos
Message 10 of 15
(4,960 Views)