03-31-2009 10:22 AM - edited 03-31-2009 10:23 AM
Hi DW,
Confessions first:
I did not review your code and have only limited experience with IMAQ (I have specialists that do image apps).
I have played around a lot with pictures.
Grey-scale image when converted to RGB end up with the three bytes RGB all set equal each other.
Once your grey scale is in RGB form and assuming the two image are of the same dimension then convert the two images to arrays and process each pixel's value one byte at a time (For RGB). The "interpolate" Vi can be feed a two element array consiting of a byte from one of you images and the associated byte from the other image with an index between "0" and "1" to control which of the two images gets the heavier weighting. The returned interpolated value converted back to a byte packed back together with all of the rest. I have used this approach to fade from one image to another.
Like this
Ben
03-31-2009 12:51 PM
Here is the output from the front panel when I alter your attached code to use a 'live feed' acquisition.
I think this is almost my answer. However, I need the output to contain the RGB information during the feed. I will continue trying to alter the code slightly to see if I am able to get the output.
Thank you,
dwfox
03-31-2009 12:57 PM
Here is the output from the front panel when I alter your attached code to use a 'live feed' acquisition.
I think this is almost my answer. However, I need the output to contain the RGB information during the feed. I will continue trying to alter the code slightly to see if I am able to get the output.
Thank you,
dwfox
03-31-2009 12:57 PM
I "cheated' in my simple example by using images of the same size. Your image
looks like you may be off by one pixel. A mis-match in size will throw-off the one to one relationship between the pixels so you will have to copmensate. When doing this please note that the rows of picture images are padded to be multiples of 8 long.
Just trying to help,
Ben
03-31-2009 02:48 PM
Okay, thanks for the help. I have seen vi's which are using the same idea as those which have been posted. However, my issue arises when I attempt to overlay onto a "LIVE FEED" from IMAQ. I accomplished the portion of the coding which overlays one picture onto another in a unique manor. However, now, I need to do the same except overlay my created picture onto my 'LIVE FEED' session. Overlaying onto the 'LIVE FEED' is the tricky part.
In reply to BEN, this coding turns the transparency to "fully on" or "fully off". I need a partial transparency level. Please refer to the zip file I attached to this thread which contains the RGB/Greyscale image I created in a like manor. In this vi, I control the amount of transparency. You can find this transparency control on the message boards by searching for "merge two images.vi" if you are curious. Nonetheless, the problem I am having is changing my coding to the "live feed".
dwfox
03-31-2009 02:49 PM
03-31-2009 04:01 PM - edited 03-31-2009 04:02 PM
You are coercing your I16 image data to a U8 input. That is one problem. You need to rescale your I16 image data to U8 image data.
You set your reshape array for that data to 245760 elements when that array should be 81920 elements since it does not have three colors. This will pad the array will alot of zeros at the end.
Take the 81920 array and feed it into a three input Interleave Array function to make it the right size and format (three sequential elements will have to same value) and then feed that into your 'merge two images' vi.
I never saw your vi that read in files, but it must have done some image conversions for you if it worked.
04-01-2009 08:47 AM
rpursley,
Nice catch! I think when I was creating the PNG file that the picture was using a the RGB version of greyscale (215,215,215); so, I had no problems. I applied to suggestions, array sizes are identical, and the numbers have been converted to 8bit. However, perhaps the issue now is a bit more common. I have attached the error jpg which I am receiving. This error pops up twice when I stop my "live feed loop." The picure is of the first error window. The second error window is the same except that I am given the option to stop the program and happens at the 'IMAQ Dispose.vi.'
I think you all will be familiar with this error. But, since I am new to labview, I am having trouble debugging this error.
Thank you all for you help,
dwfox
04-01-2009 10:41 AM
05-01-2009 04:49 AM
hi
iam new to labview i want to make some colors look transparent in labview is this possible please can any one help me out