ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

selecting a portion of an image

Hello

 

I am having an image displayed in the front panel. Now i want to select a portion of the image such that when i select that particular portion in the front panel , the result is displayed. Is this possible?

 

AT present what i have done is, i take a subset from the image 2D array. But here i always have to enter the index and length by trial and error to locate the exact position. Is there a possibility to automatically detect the index and length when i select that portion in the original image???

 

Thankyou

Nghtcwrlr

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

Hi Nghtcrwlr,

you can use an Event Structure to read the mouse down/up/move position. If you store it in a shift register, you can use it to cut the part of the image you are interested in.

 

Mike

0 Kudos
Message 2 of 8
(3,545 Views)

Hello Mike

 

How can we read the mouse down/up/move position in an event structure? I didnt fully understand.Could you please show an example.?

thnx

Nghtcwrlr

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

Hi Nghtcrwlr,

see the attached example please.

 

Mike

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

Hello Mike

Thankyou very much for you example. This was what i meant. I have modified ur VI to what i need. But still am having a difference. When i click a particular point in the original image, iam getting the result image at a distance away from where i click on original image. I tried to subtract the original pic size from both but still not wrkin. any idea?

 

Thnx

Message Edited by Nghtcrwlr on 02-12-2009 05:54 AM
Nghtcwrlr

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

Hi Nghtcrwlr,

see the attached example. You can select the part you need with the image. Mouse down -> move -> mouse up.

 

Mike

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

Hello Mike

Thanx... it worked. But i have one more question. How can i link the selected image to be used for another operation in the same VI. I tried to wire the output of the array subset out of the loop. But value is not coming out.

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
Message 7 of 8
(3,494 Views)

Hello Mike

I made it myself.Smiley Happy now its wrking...

 

anywyzz thnxx

Nghtcwrlr

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