LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET picturebox to array

Hello,

I have attached a screengrab of a LabView VI, which came with my camera and it is working fine to show a live image. It is a Thorlabs DCC1645C USB camera, and I am using LabView Base 2017. 

I would like to do some processing on the image, so I want to obtain the image as an array in labview. 

But I am struggling to get the image from the picturebox to an array. There is not error, but it seems to only work on the first iteration, and not for subsequent iterations.

I've tried to indicate the bits I added to the VI: I take the picturebox and use a Get Image' method node (I think?), which gives me the image data. Then I unflatten the pixmap, and display this as my array. I also have an intensity graph but it's just to see what's going on.

I have also attached the whole VI but I guess you won't be able to initialise a camera if you don't have one.

Many thanks for any help, I'd really like to understand what I'm doing wrong!

Graham

Download All
0 Kudos
Message 1 of 4
(2,961 Views)

Hello Graham,

image manipulation with .NET images is quite tricky in the beginning. Had you seen this thread titled ".NET picturebox convert to LabView image", especially Hooovahh's code for taking an image from a picturebox, and converting it to e.g. a png? It should be easy to adapt this to your needs.

 


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 2 of 4
(2,916 Views)

Hi ikaiser,

Thanks for directing me to Hooovahh's code. I downloaded it and it helped me understand some things better.

I have managed to work out a solution (attached), possibly not the best, but it works sufficiently for me.

Thanks!

 

Message 3 of 4
(2,903 Views)

Thanks for posting your results! It's good to know my hint was helpful, especially for others, finding this thread in the future. Feel free to mark your posting as "solution", so it is quicker to find.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 4 of 4
(2,889 Views)