03-23-2015 02:06 PM
http://www.tannerhelland.com/3643/grayscale-image-algorithm-vb6/
Method 2 – Correcting for the human eye (sometimes called “luma” or “luminance,” though such terminology isn’t really accurate)
Grayscale generated using a formula similar to (Red * 0.3 + Green * 0.59 + Blue * 0.11)
you have to calculate this for each pixel!
03-23-2015 02:20 PM
No, maitaining pixel intensity is not required for case 1
If I add G&B, it is simply like summation of 2matrix, and the value of "pixel a" in G will be added to pixel a" in B.
I tried to wire the outlet of "+" to IMAQ array to image but it does't work this way I have to use something to convert it to format that is acceptable by this vi inlet
many thanks
03-23-2015 02:29 PM
Hi
Thanks for your reply,
No I can't use this formula. 1. I should just remove R, Convert G & B to array, and add (combine) them using math functions, then convert it to an image then grayscale
2. for second case I should convert R, G &B to array, and add (combine) them using math functions, then convert this to an image then grayscale
Regards
03-23-2015 02:35 PM
VItan,
value is different from intensity? I thought value of each pixel means its intensity smileyembarrassed:
03-23-2015 03:23 PM
Have u recieved my reply?
03-23-2015 04:27 PM
Hi VItan
I realized what is my mistake im previous code. I cant use IMAQ color Image to array, bcoz I have my G&B are in grayscale, so I used IMAQ Image to array, and added them to create the new matrix, now I am going to convert this to an image using IMAQ arrat to image
Thanks for your help
03-23-2015 05:12 PM
@sara14 wrote:
VItan,
value is different from intensity? I thought value of each pixel means its intensity
I'm sorry, I just realized that I had been making a great, and probably incorrect, assumption this whole time. I was thinking of "intensity" of the original image's pixels as a single value per pixel, something like HSV value, HSL luminosity, or a straight RGB average. Not even a well-defined assumption! I'm now not sure at all what you meant regarding maintaining intensity:
I have to convert my image to Grayscalein such a way that the value of intensity of each pixel doesn't change
However, everything you have said since seems to indicate that you are not concerned with the original image and simply want a G+B summation image and a R+G+B summation image. In that case, it sounds like you have what you need, although I do not know how you plan to map the summed values to grayscale: As I mentioned earlier, the summing of planes' values can go over the U8 representation limit, so you will need to either limit the sum to 255 or sum them into a larger representation and then convert that as something other than a U8 grayscale...
03-23-2015 05:42 PM
Hi VItan
Thank you very much for your kind reply. it is fine, I am new in this field so I make many mistakes. By intensity I mean the value of voltage that has been recorded by the CCD camera for each pixel.
Yes, I have grabbed and saved several images using my camera. Sor to run this new program I use them. As you can see here, every time that I hit run, since the first step is open file, it askes me for the file, so I select the file and it runs.
Now, I have problem with the combination of R+G+B, it dosent show this image.
my input image is RGB(U32), then I have extracted R, G, B and have displayed them all as Grayscale (U8), ...I am not very good at this I cant find my mistake. every thing is fine only R+G+B image is not displayed in FP vindow
May plz have a look
03-23-2015 05:49 PM
If you dont mind, may I send my file to you in private window? Bcoz I dont know how to remove it later on. I am new in this froum, still not familiar with stuffs here