03-19-2014 04:24 PM
i have the following attachment of code.
Im trying to take a color image
then convert it to black and white
But using the standard conversion formula
http://en.wikipedia.org/wiki/Grayscale
gray = 0.299*Red + 0.587Green+ 0.114*B
The attached code is my attempt at this.
Im not sure what im doing wrong.
I keept getting an error 'invalid image type'
The basics are that i am trying to extract the RGB from the image
Then apply the scalar offsets.
then combine the three arrays into the one grayscale.
ideally i figured there would be a premade function to do something like this.
im not talking about just capturing one channel though.
The acquistion is done inside a loop as the display needs to be done repetitively
The save is only at the end
Ive attached a screen shot of my MAX of the camera
Any help is appreciated.
03-19-2014 11:06 PM
Your attachments did not make it into your message.
03-20-2014 09:09 AM - edited 03-20-2014 09:10 AM
attachments should be on this time.
not sure why they didnt show
03-21-2014 08:41 AM
Any help on this is appreciated..
03-21-2014 04:09 PM
I believe the problem appears to be with the IMAQ ReplaceColorPlane VI. If you open the detailed help for this VI, it shows that's expecting RGB or HSL images types. Whereas, you're passing it U8 grayscale images. If you would like to combine the different grayscale images you're generating into a single image through addition, try using the IMAQ Add VI.
03-23-2014 11:20 AM
hi jimmyinct3,
I I don't have access to Vision, so I can't test if my approach would work, but I think this is not a Vision-specific task.
Here's my plain Labview approach:
Please note:
The color input-picture is in u32 as well as the grayscale output-picture
Regards,
Alex
03-24-2014 05:17 AM - edited 03-24-2014 05:19 AM
Hi, Biosolutions,
I thought you may not use the pixel manipulation within it, instead of image operators.
Then you can apply the U8 format to the result image.
03-27-2014 10:24 AM
Hi
I work with the guy who posted this question.
The file you uploaded is version 2013 and I have 2012 on mine and cannot open it. Could you please convert it to 2012 and re-post it? I appreciate your help.
03-27-2014 09:14 PM
Hi,
I'm not sure the VI is what you want, I've saved it to LabVIEW 2012.
You can try it:)