08-20-2009 02:53 AM - edited 08-20-2009 03:01 AM
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
Solved! Go to Solution.
08-20-2009 03:07 AM
08-20-2009 03:14 AM
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.
08-20-2009 03:26 AM
Yes you need to convert them to array and feed it. (sadly)
08-20-2009 04:27 AM
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...
08-20-2009 05:15 AM
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.
08-20-2009 06:16 AM
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...
08-24-2009 02:43 AM
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 yes, there is something ... ^^
and this is what I expected as the result of the calculation
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])
08-24-2009 03:15 AM
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
08-24-2009 03:27 AM
Hi Pandamütze,
you see the calculation is the smallest problem in LabView here. Most work is loading and saving the images
(Don't have IMAQ installed so can't comment on that. I would have used the standard picture functions...)