Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Weird Image Display Error...IMAQdx

Hello,

 

Instead of using/modifying the vi someone gave me, I decided to use a vi I already had and did some modifications to it using an example from particle analysis (particle orientation). This vi should: give the area/center of mass (in the x &y directions) of centroids, to begin with, and also to give the distance between two or more objects. First, I get a weird error when I run the vi, I can't see the image on my main image display while I see it on the small display (particle analysis one), they both are connected to the same wire, I don't understand how it is possible. The second smaller display that is marked as "results" doesn't display anything too, but, again,the results do appear in the array display....

The last error, when I press "stop" of the while loop, I get an error trying to close the camera. Isn't the close camera procedure should be outside the main loop ?

Lastly, the current version doesn't calculate the distance yet, as I didn't put the algorithm yet. I'm been reading about it, which approach is the best to find x&y coordinates (in order to find a distance between to points/centroids)? Is it boundary detection?

 

I really appreciate any thoughts/help on those issues.

Thank you,

 

P.S.

I've attached the vi and one of the images I used to test it on.

Download All
0 Kudos
Message 1 of 8
(3,964 Views)

Hi,

 

First, right click your main image and check "snapshot".  You should see the image now. And, a few notes about the image data type.  Unlike other data types in LabVIEW, you are actually just passing a reference to the image rather than the whole image (images are typically large and this was done to mitigate this).  Therefore, you've only created on buffer, so no matter what, you are going to see the same thing on all three of those image displays.  Test it out: do a simple read image from file, and then an IMAQ rotate (or something else that is blatantly obvious).  Make two image displays.  Notice that even if you are only rotating "one"  image, since they both point to the same buffer of data, you'll see the same thing.  Keep this in mind when programming.

 

Second, define weird error.  What is it--number/description?

 

Cheers,

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 2 of 8
(3,947 Views)

Hi Marti,

 

Thank you for the "snapshot" help. I actually need either the main display or the main plus the Measurements which will be nice. I've tried the snapshot, and it did get the main display to work, but the measurement display doesn't work. It's basically wired the same as in the example: Particle Orientation example.vi (I can upload it if you want). Thus, I'm not sure why it is not working because as you can see in the image I've attached it recognizes the centroid (the table in the lower left corner). This brings another issue, in the example, it recognizes each rectangle and gives it a value (in the x and y directions), here, to my understanding, it should only give one value for the centroid (x & y) meaning the array/matrix should be 1*3 not 7*3..I'll look into it.

As far as the error, I get the same error twice when I press the stop button of the while loop:


Error -1074396080 occurred at IMAQ DrawText
  Invalid image type.

 

Possible reason(s):

IMAQ Vision:  (Hex 0xBFF60450) Invalid image type.

 

Any idea how to fix it?

Thank you again for your help, I really appreciate it.

 

0 Kudos
Message 3 of 8
(3,943 Views)

I've just ran the vi again, apparently it discovers between 20-30 particles. Could this number come from the non uniformities of the laser (because in a closer view one might see "wavelets" of the laser) or is it an error in my algorithm? (how can I check it?)

0 Kudos
Message 4 of 8
(3,941 Views)

Hi,

 

First, this article is very helpful for determining what type of image you need to avoid that invalid image error: Supported Image Types

 

Second, I'd recommend using the Overlay functions in your code to determine where it thinks the particles are.  Then you can tweek the settings for your particular application.  However, looking at your image, I'm not sure why you are using the particle analysis--are you just wanting to find the large spot in the center? If so, there may be some more appropriate vision functions we can look at.

 

Cheers,

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 5 of 8
(3,910 Views)

Hi Marti,

 

Thank you for the link.

Do happen to know of an example that uses Overlay functions in such manner?

Going a few steps back, the vi I try to construct should eventually detect a number of centroids (in a shadowgram image, 2-3 black centroids on a white-grey background), give their area (in the x&y directions), and their coordinates. For those objectives, I thought that particle analysis is the best and simplest option. What approach would you recommend?

I've used this image just to test the basics of the vi (i.e. grab the image and do the analysis of that one centroid).

 

Thank you,

 

 

 

 

0 Kudos
Message 6 of 8
(3,902 Views)

Hi,

 

There is an example actually--check under Toolkits and Modules>Vision>Functions>Overlay Grouping Example for some background information on working with overlays. 

 

As for the processing portion, it depends on how you are finding the places that you'd like to draw the circles--what types of cues are you using in the image?  I'd also recommend using Vision Assistant to try out different processing sequences without having to do too much programming.

 

Cheers,

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 7 of 8
(3,870 Views)

Thanks Marti,

 

I'll look at the example and give vision assistant a try.

Well, right now I believe that the objects are found due to the contrast from the background (I'm not sure if that's what you meant by image cues and draw the circles).

0 Kudos
Message 8 of 8
(3,868 Views)