LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

thresholding of an image

Solved!
Go to solution

Hello

 

I woulod like to do thresholding for an image without using IMAQ functions. How is it done? Can anyone explain the step by step procedures for it or post an example?

 

Thanks

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
Message 1 of 8
(3,856 Views)

without imaq, you can take your array version of an image (pixel map) and compare it to the threshold (greater than) this will return a 2d array of booleans which can be converted to u8 where 1 is above th and 0 is below th. you can also do it for a range by doing a range check (in range?) and getting your boolean array there.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 8
(3,852 Views)

Hello flakpl

 

I am having a  an image of 2D array .. its a complex array. How can i do the thresholding with it. I tried to convert the 2D array to 1D and the compare with a value (eg 255). but it didnt work.  cudnt proceed further. 

Can you help me?

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 8
(3,825 Views)

Hey Nghtcrwlr,

 

can you post your VI?

 

Thanks,

cheggers 

Sascha
0 Kudos
Message 4 of 8
(3,814 Views)

Hello Cheggers

 

I am not sure whether one could do thresholding with complex numbers. Do we need to extract the real part of the complex number and compare it? anyways i was not able to run this vi. see attachment.

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 8
(3,800 Views)
Solution
Accepted by topic author Nghtcrwlr

Well, you don't really have an "image", but a 2D complex array. One (of many!) possible interpretation for a "threshold" would be to compare the absolute value R for each element.

 

You don't need any FOR loops for this. Here's one possible solution. Modify as needed.

 

Message Edited by altenbach on 02-04-2009 04:43 PM
Download All
Message 6 of 8
(3,792 Views)

altenbach shows an implementation of what I discribed.  A threshold is simply a per pixel comparison (>, < or in range) and the value is usually a 0 or 1.  This produces a binary image.  Using the polymorphic nature of labviews comparison a 2d array doesnt have to even be converted (an infact it usually is faster to not use a nested loop).

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 7 of 8
(3,781 Views)
Thank you very much you folks!!.... it helped me a lott...nw am clear!!
Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 8 of 8
(3,759 Views)