LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use this formula for images?

Solved!
Go to solution

Hi there!

 

I'm new to Labview and I don't get on with the following problem.

 

What I'd like to do is use the following formula with three color bmps

 

I=sqrt[(I1-I2)^2+(I1-I3)^2+(I2-I3)^2]            I is the resulting intensity, I1,I2,I3 are the intensities from the three images.

 

At the moment, I use already saved images, later I'd like to get them from a camera (get 1. image, move Piezo; get 2. image, move Piezo...)

 

I tried to convert the images to arrays and apply the formula to them, but that didn't work.

 

So how do I do this calculation?

Is there a possibility to pass the images to Matlab? (I use Matlab for the calculation now and its working fine, but I need to automate the whole process)

 

I hope someone can help ^^

 

Pandamütze

 

PS: I use Labview Version 8.6 including LabviewVision

Message Edited by Pandamütze on 08-20-2009 03:01 AM
0 Kudos
Message 1 of 10
(3,722 Views)
Did you try math script in labVIEW?
0 Kudos
Message 2 of 10
(3,712 Views)

Hm... I tried but there was only the possibility to pass an array to matlab. it would have been nice if i was able to pass the image as it is, because the matlab script works with the images without converting them to arrays.

0 Kudos
Message 3 of 10
(3,702 Views)

 


Hm... I tried but there was only the possibility to pass an array to matlab. it would have been nice if i was able to pass the image as it is, because the matlab script works with the images without converting them to arrays

 

 

Yes you need to convert them to array and feed it. (sadly)

0 Kudos
Message 4 of 10
(3,697 Views)

Hi pandamütze,

 

you have 3 images. Are they always the same size?

If so I would get the image content as array, calc the "intensity" for each (you should define "intensity" clearly) and then do the error calculation with standard math without any loops/matlab/mathscript involved...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 10
(3,665 Views)

the images are all of the size 2080x1542

 

I just read this "The basic data format for an image is a two-dimensional (2D) matrix, where the value of each element (a pixel) is the intensity at a physical location." which means I have to do the calculation for each Pixel. 

 

to get the "conventionel" image (the project is called "Structured illumination"), I use the imageadd to caculate (I1+I2+I3)/3.

0 Kudos
Message 6 of 10
(3,641 Views)

Hi pandamütze,

 

see example for calculation using standard math...

 

Your description of intensity is still vague. When using 24bit color images you usually get a 32bit value per pixel containing the RGB colors (each 8 bit). This is no intensity! Intensity can be seen as gray level of the pixel, but there are different conversion from RGB to graylevel possible...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 10
(3,620 Views)

Hi!

 

this is what I came up with ^^ I'm not sure if its working like this, but after all, the result looks a bit better than before

 

thats what I got CHO3_struk_test.JPG yes, there is something ... ^^

and this is what I expected as the result of the calculation CHO3_struk.JPG

 

the images I load in look similar, just with stripes on them (the point is to calculate an image from the focal plane by using three images with a projected grid pattern [pattern moved 1/3 of a period between the images])

0 Kudos
Message 8 of 10
(3,590 Views)
Solution
Accepted by topic author Pandamütze

problem almost solved. I get the right image, just a bit darker than the resulting image of the matlab calculation

 

I attache my latest VI if someone is interested

 

thanks to you, thinking about your questins helped a lot ^^

 

Kind regards

Pandamütze

 

 

0 Kudos
Message 9 of 10
(3,583 Views)

Hi Pandamütze,

 

you see the calculation is the smallest problem in LabView here. Most work is loading and saving the images Smiley Wink

 

(Don't have IMAQ installed so can't comment on that. I would have used the standard picture functions...)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(3,576 Views)