grayscale

Grayscale image from binary data

丶灬走出姿态 提交于 2021-02-08 08:58:22
问题 I'm working on some simple viewer app for CT images. Let's say I have array of 262144 Int16 values. Each value represents one pixel in 512x512 image. Each pixel has value from 0 to 4096 where 0 is black and 4096 is white. Is there any elegant, simple solution to display this image in Visual Studio Picture Box? Maybe some kind of MemoryReader or Stream? I've tried to search for some solution but found only topic about retrieving binary data from databases. 回答1: A good way and with a good

Java for ImageJ. How to convert an image from RGB to 8 bit using code?

淺唱寂寞╮ 提交于 2021-02-08 04:07:39
问题 I am currently working on Connected Component Labelling. This is a process which takes an image and tells you how many separate objects are in the Image. My problem is that at the very start I need to be able to take any image (specifically RGB value) and convert it into 8-bit. EDIT: as in literally considered an 8bit, where the image is no longer recognised as RGB. Not an 8bit image that is recognised as an RGB. Is there a way using code to automatically do this without having to go into the

How to turn grayscale into false color using PIL?

别说谁变了你拦得住时间么 提交于 2021-02-07 03:48:51
问题 I can't seem to figure out how to take my grayscale function and change it to give me false color. I know I need to break each color (R,G,B) into ranges and then assign colors based on the range for each color. Does anyone have any idea how this can work? def grayscale(pic): (width,height) = pic.size for y in range (height): for x in range(width): pix = cp.getpixel((x,y)) (r, g, b) = pix avg = (r + g + b)//3 newPix = (avg, avg, avg) cp.putpixel((x,y),newPix) return cp 回答1: Since you never

How to turn grayscale into false color using PIL?

让人想犯罪 __ 提交于 2021-02-07 03:47:43
问题 I can't seem to figure out how to take my grayscale function and change it to give me false color. I know I need to break each color (R,G,B) into ranges and then assign colors based on the range for each color. Does anyone have any idea how this can work? def grayscale(pic): (width,height) = pic.size for y in range (height): for x in range(width): pix = cp.getpixel((x,y)) (r, g, b) = pix avg = (r + g + b)//3 newPix = (avg, avg, avg) cp.putpixel((x,y),newPix) return cp 回答1: Since you never

What is the fastest way to convert JPEG byte data to raw greyscale byte information?

醉酒当歌 提交于 2021-01-28 09:22:09
问题 Since the Raw callback from takePhoto is not reliable I have to use the JPEG callback... What I'm basicly getting is a byte array which holds all the information in JPEG data-form. I now need to somehow get this to be only grayscale information with each pixel having a value of 0-255... At the moment I'm converting the jpeg data array to Bitmap using BitmapFactory.decodeByteArray and then converting the bitmap to grayscale by using getPixel(), which is pretty bad performance wise... Does

Transform a colored image to a grayscale image using XAML?

蹲街弑〆低调 提交于 2021-01-27 07:03:50
问题 Using XAML preferably, I need to dynamically apply a gray-scale filter on a colored image from bottom to top. That's to say, i would like to be able to change the offset value of the gray-scale filter applied to my image pro grammatically. For example, I would like to programmatically set 50% of the image in color (from the bottom of the image to its middle), and the other 50% of the image in gray-scale (e.g. from the middle of the image to its top). I have read a lot of different answers,

Detection of certain pixels of a grayscale image

ぃ、小莉子 提交于 2020-12-13 07:08:18
问题 I have this code that allows you to detect pixels of a vertain value. Right now I'm detecting pixels over a certain value (27). My idea would be to still detect them but to detect another pixel values (I want to detec pixels from 65 to 75, another interval of pixels). How can I do this? As you may see, T'm detecting grayscale images, so I have this same value for red, green and blue. Any idea to improve this program in order to work faster would be really appreciated. Sucha as using os.walk

Detection of certain pixels of a grayscale image

走远了吗. 提交于 2020-12-13 07:03:36
问题 I have this code that allows you to detect pixels of a vertain value. Right now I'm detecting pixels over a certain value (27). My idea would be to still detect them but to detect another pixel values (I want to detec pixels from 65 to 75, another interval of pixels). How can I do this? As you may see, T'm detecting grayscale images, so I have this same value for red, green and blue. Any idea to improve this program in order to work faster would be really appreciated. Sucha as using os.walk

Detection of certain pixels of a grayscale image

为君一笑 提交于 2020-12-13 07:03:26
问题 I have this code that allows you to detect pixels of a vertain value. Right now I'm detecting pixels over a certain value (27). My idea would be to still detect them but to detect another pixel values (I want to detec pixels from 65 to 75, another interval of pixels). How can I do this? As you may see, T'm detecting grayscale images, so I have this same value for red, green and blue. Any idea to improve this program in order to work faster would be really appreciated. Sucha as using os.walk