LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why real indexes are returned by coutour line.vi ?

Hi,

     I am working on image processing and to find contour I used contour line.vi on a gray image. It is working perfectly and XY graph is displayed properly. But the index are not as per the image matrix index. these are real number with 4 digits after decimal point.

I want the indexs which are on actual image as I have to track back the contour position on real image. How to get it?

Hope someone will come up with some idea.

Thanks..

 

Sukhiray

0 Kudos
Message 1 of 12
(3,664 Views)
some things exist that you have to regard it
1 image matrix start from top and left
so most top left pixel is (0.0)
also if you want real data you have to calibrate your image first
algorithms that find contours could produce data with fractional value based on algorithms functions
0 Kudos
Message 2 of 12
(3,655 Views)

@Hatef.fouladi wrote:
some things exist that you have to regard it
1 image matrix start from top and left
so most top left pixel is (0.0)
also if you want real data you have to calibrate your image first
algorithms that find contours could produce data with fractional value based on algorithms functions

Thank you for your response.

 

I know that graph and image matrix has different way of indexing and so display gets changed.  But index of a pixel value remain unchainged.

My problem is different. Image matrix has index value all integer.  But after ploting contour the returned indexes are real number like 370, 370.1423, 370.2435 (say y values) etc. where as in actual image there was only 370 as y value.

Is there any way to get rid of it?


Thanks.

0 Kudos
Message 3 of 12
(3,632 Views)

could you send some image or vi?
also as i remember data from countour are not just y value 
they are x0,y0,x1,y1,.....xn,yn

0 Kudos
Message 4 of 12
(3,613 Views)

If you send that into some function where you need integer values, you can convert to the data type you need before passing it in, or just pass in the "double" type values and let it coerce them (indicated by the coercion dot).

 

Hatef correctly stated above that just because your indices are integers, does not mean that the algorithm has to spit out integers. What if you did a simple algorithm, like take the mean, of an array containing the values 1 and 2. Would you expect an integer result, or 1.5?

0 Kudos
Message 5 of 12
(3,593 Views)

@Gregory wrote:

If you send that into some function where you need integer values, you can convert to the data type you need before passing it in, or just pass in the "double" type values and let it coerce them (indicated by the coercion dot).

 

Hatef correctly stated above that just because your indices are integers, does not mean that the algorithm has to spit out integers. What if you did a simple algorithm, like take the mean, of an array containing the values 1 and 2. Would you expect an integer result, or 1.5?


Thanks For your response.
Yes I can change datatype to get integer. But that is introducing some odd errors.

and yes, both of you are right. Though the array if of integer, the computation can return real number. But I am talking about the indixes of the computed pixels. If you calculate contour of an array of binary image and then return the indexes of pixels on contour line, you will see that those are not integer. But in the inpur array there was no fcational location was given. This is what is my confusion.

0 Kudos
Message 6 of 12
(3,585 Views)

@Hatef.fouladi wrote:

could you send some image or vi?
also as i remember data from countour are not just y value 
they are x0,y0,x1,y1,.....xn,yn


Hi,

    Yes. You are right. It is basically a 2D array of 2 rows and n number of columns.
and in both the rows, there are few indexes which are integer. And finally there is no columns where both indexes are integer.

See the attached file.

Thanks for your support.

 

0 Kudos
Message 7 of 12
(3,576 Views)

You can check out "Interpolate 1D Array" if you want to put in a fractional index and get the corresponding (interpolated) value out.

0 Kudos
Message 8 of 12
(3,567 Views)

Hi

Thank you all for your support.

I did a bit studdy on contour and as per my understanding it is not possible to get integer data from it anyway.

So, I have to think some otherway to gey actual location indexes.

Thanks all for their support and active participation.

 

0 Kudos
Message 9 of 12
(3,485 Views)
I had many project about the contour analyse what you want to do with them ?
may be I can help you
0 Kudos
Message 10 of 12
(3,466 Views)