LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What contourc function returns

Solved!
Go to solution

This question is actually about Matlab, but the thing is I don't really use Matlab; Matlab is simply a labor for LabVIEW in the code. 

 

In Matlab, there is a function called c=contourc(im,[.8 .8]). This function is supposed to return a single contour at level 0.8. The return is a 2X387 matrix in this case. Can someone tell me what this matrix is? It does not look like a collection of pixle positions.  

 

Is there an efficient Matlab forum like this NI forum somewhere?

 

 

0 Kudos
Message 1 of 8
(3,480 Views)

Perhaps this Mathworks forum is what you're looking for:  http://www.mathworks.com/matlabcentral/answers/

 

 

James McNicol

Applications Engineer

National Instruments

James M. | Applications Engineer | National Instruments
0 Kudos
Message 2 of 8
(3,469 Views)

James, 

 

Is there similar function in LabVIEW? I am trying to convert a m code into LV. Thanks.

0 Kudos
Message 3 of 8
(3,460 Views)
Solution
Accepted by topic author MengHuiHanTang

Hi Meng Hui,

 

I'm not sure of the exact purpose of that Matlab function, but is this close to what you're looking to do?

 

http://zone.ni.com/reference/en-XX/help/370281M-01/imaqvision/imaq_extract_contour/

 

 

 

James McNicol

Applications Engineer

National Instruments

James M. | Applications Engineer | National Instruments
0 Kudos
Message 4 of 8
(3,436 Views)

Thanks, James. 

 

That matlab function is used to return a contour, but I guess the difference is that the matlab contour function uses interpolation and therefore returns a DOUBLE contour line instead of Integer coordinates. 

0 Kudos
Message 5 of 8
(3,425 Views)

A function much closer to the Matlab one is included in LabVIEW 2011: Contour Line which is under the Mathematics/Geometry/Computational Geometry palette.  This works on 2D DBL arrays.

 

ContourLine.png

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

Greg, 

 

Thanks for the update. That's good to know. 

 

What is the input 'Height' for? Contour line is in a 2-D image. 

0 Kudos
Message 7 of 8
(3,403 Views)

Height specifies the value at which you want a contour.  Think of your 2D array as Z-values at a range of X-Y locations - then Height is the value of Z for contouring.  This is a polymorphic VI, so you can also provide an array of heights, or ask for a certain number of contours, and the heights will be automatically selected.  If you use those options, then the height of a given contour is returned in the Contour Line cluster as shown.

 

 

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