|
I was trying to do image processing of 16 bits grey scale images. The bitmap can only handle 8 bits. How can I access the pixel data safely or unsafely from the Image object?
Many thanks,
GL
|
|
|
|
|
Hello Everybody,
I want to change my 8 bit and 16 bit image to gray scale images. how to use pixelformat.format16bppGrayscale.
Prakash
|
|
|
|
|
This may not be relevent to what as u have not given details of ur problem but check this convertion in order to convert any RGB image to grey scale u have a very simple solution as follow
step1 : take the RGB values seperatly for a pixel
step2 : Know take any of this value from RGB and assign it to other 2.
Like suppose R = 150 then R=G=B = 150
step3 : apply this new value to the pixel and the whole image turns Grey Scale
Kishorda
|
|
|
|
|
>>step1 take the RGB values seperatly for a pixel
>>step2 : Know take any of this value from RGB and assign it to other 2.
>>like suppose R = 150 then R=G=B = 150
>>step3 : apply this new value to the pixel and the whole image turns Grey >>Scale
This won't likely give you the results you want. You'll end up with a grayscale image for sure - but it will only reflect the intensity of a single color channel. Areas of your picture that are heavily r, g, or b will be under-represented in the final image. For example - if you had a heavily blue image but chose to use the r channel for your conversion then you'd end up with a very black picture.
Better to average the channels or use the highest of the three - or some other sensible scheme.
-matt redmond
|
|
|
|
|
The correct formula for getting a grayscale image of R,G,B values is to calculate the "distance" of the colors like:
GrayValue = Math.Sqrt((R*R+G*G+B*B)/3);
Then assign
R = GrayValue
G = GrayValue
B = GrayValue
Enjoy,
Smallhorse
|
|
|
|
|
Since the eye isn't equally sensitive to red, green and blue, it is not a simple matter of an average or distance calculation.
The correct balance is:
GrayValue = 0.299*red + 0.587*green + 0.114*blue;
/Morten Nielsen
http://www.iter.dk
|
|
|
|
|
The eye perceives color channels differently. To convert RGB to grayscale, use
Gray = Red * 0.299 + Green * 0.587 + Blue * 0.114
|
|
|
|
|
How to display this 8 bit grey bytes in c#?
|
|
|
|
|
Did you land up getting this to work. Im trying to do the same thing w/o much luck.
-jbs
|
|
|
|
|
<br />
public Bitmap Bytesto8BMP(ref byte[] buffer,int width,int height)<br />
{ <br />
PixelFormat pixelFormat = PixelFormat.Format8bppIndexed;<br />
Bitmap bmp = new Bitmap (width,height,pixelFormat);<br />
<br />
BitmapData bd = bmp.LockBits( new Rectangle( 0, 0, width, height),<br />
ImageLockMode.WriteOnly, pixelFormat );<br />
<br />
Marshal.Copy(buffer, 0, bd.Scan0, width*height*3 );<br />
bmp.UnlockBits( bd ); <br />
<br />
<br />
return bmp;<br />
}<br />
<br />
Try this and let me know ..I suspect there is a memory leak occured in this code ..
Thanks in advance if someone can point out that
cheers
|
|
|
|
|
hello
i am working on a Image Processing project, i need algo/code on morphology,finding skeleton of a video camera image,Regional descriptors....
can anybody plz guid me
my email id is
prit_me@hotmail.com
VC++
|
|
|
|
|
Mr Kishor
i am developing an application in VC++....i am using image procssing concepts....but need help...can i please have your direct email id.
on your homepage i see no link to contect you.
bye thanks.
my email id is notifypinky@rediffmail.com
VC++
|
|
|
|
|
my id is kaher@celpro.com
Kishorda
|
|
|
|
|
Hey there,
Did you recieve my email regarding the biometric project Im working on? Let me know. Talk to you soon.
ZiPPy
|
|
|
|
|
i've problem with putting Grey scale image
i browse grey scale image but the program don't accept that ???!!!!
|
|
|
|
|
i want to know how to make Image segmentation & edge detection
i want to make program that identify Signature
could u help me ????
modified 5-May-17 20:57pm.
|
|
|
|
|
My image processing articles in C# show how to detect edges.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
public static Bitmap Wiener(Bitmap use)
{
Bitmap wien= new Bitmap(use.Height,use.Width);
int i,j,N;
uint tmp=0;
uint mM,M1,mVAR;
Are you kidding me?!?
modified 5-May-17 20:57pm.
|
|
|
|
|
Since C# is a new language it is very difficult to find Image processing Library on this Platfrom
That's odd, seeing as I have 5 articles on this site which between them build a library for image processing in C#.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
Christian Graus wrote:
That's odd, seeing as I have 5 articles on this site which between them build a library for image processing in C#.
You know the problem with you CG, you lack visibility. Perhaps you should post more
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
You're right, perhaps I should give you my password. BTW I've been a bit quiet ( and about to be more so, losing DSL for three weeks ), are you top poster again yet ?
I had a glance through this code and it is *awful*.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
It'd probably be fairly easy to make a bot that'd post random stupid VB questions, and nobody would probably ever notice - benjymous - 21-Jan-2003
|
|
|
|
|
Christian Graus wrote:
are you top poster again yet ?
Nope. It actually feels nice at #2 No pressure. New people will only notice the #1 poster. The others in the top-10 will simply be others Now I hope to shed the stereotype image of a 24 hour posting bot I had for the last one year
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|