color-depth

ImageConverter byte a

旧城冷巷雨未停 提交于 2020-04-30 16:57:11
问题 am trying to convert a grayscale image to a byte array. I use the following code. however, the byte array generated is not of the logical size. ImageConverter converter = new ImageConverter(); byte[] test = (byte[])converter.ConvertTo(gpuMatch.Bitmap,typeof(byte[])); the image is a grayscale 792x410 8 bit depth. so should'nt the array size be 324720 bytes? i am getting something close to 140122 elements in the byte array. ImageConverter ic = new ImageConverter(); Image img = (Image)ic

How to capture depth data from camera in iOS 11 and Swift 4?

≯℡__Kan透↙ 提交于 2019-12-28 12:52:32
问题 I'm trying to get depth data from the camera in iOS 11 with AVDepthData, tho when I setup a photoOutput with the AVCapturePhotoCaptureDelegate the photo.depthData is nil. So I tried setting up the AVCaptureDepthDataOutputDelegate with a AVCaptureDepthDataOutput, tho I don't know how to capture the depth photo? Has anyone ever got an image from AVDepthData? Edit: Here's the code I tried: // delegates: AVCapturePhotoCaptureDelegate & AVCaptureDepthDataOutputDelegate @IBOutlet var image_view:

How to capture depth data from camera in iOS 11 and Swift 4?

≯℡__Kan透↙ 提交于 2019-12-28 12:50:11
问题 I'm trying to get depth data from the camera in iOS 11 with AVDepthData, tho when I setup a photoOutput with the AVCapturePhotoCaptureDelegate the photo.depthData is nil. So I tried setting up the AVCaptureDepthDataOutputDelegate with a AVCaptureDepthDataOutput, tho I don't know how to capture the depth photo? Has anyone ever got an image from AVDepthData? Edit: Here's the code I tried: // delegates: AVCapturePhotoCaptureDelegate & AVCaptureDepthDataOutputDelegate @IBOutlet var image_view:

Convert kinect RGB and depth values to XYZ coordinates

只愿长相守 提交于 2019-12-21 05:23:10
问题 I'm looking for an easy way to Convert kinect RGB and depth values to XYZ coordinates using MATLAB. My goal is a function with an input of: RGB and depth values of each point taking by Kinect camera, and output of: x,y and z values of each point. [RGB, depth] = RGB_D2XYZ(XYZ) Thanks, Ben 回答1: You can have a look to this great article. They have a function call DepthToCloud.m. You just need to be sure to pass Image center and top-left corner. They are using Kinect too, so you don't really need

C# - How to convert an Image into an 8-bit color Image?

廉价感情. 提交于 2019-12-20 04:22:18
问题 I need to convert a PNG Image loaded from a file into an 8 bit-per-pixel byte array used by another device (embedded programming). I'm copying over pixel by pixel into a new Image created with a 16-bit color - Format16bppRgb565 , but I need Format8bpp , which is not present in the .NET Framework. (I cannot use Format8bppIndexed since the other device cannot handle indexed bitmaps) Bitmap img = new Bitmap(imgPath); Bitmap img8 = new Bitmap(imgW, imgH, PixelFormat.Format16bppRgb565); for (int I

LCD 8-bit mode to 4-bit mode

允我心安 提交于 2019-12-12 16:35:04
问题 We have a character LCD (www.cloverlcd.com/pdf/S6A0069.pdf) that we got to work in 8 bit mode. However, now we are trying to get it to work in 4 bit mode but it doesn't seem to be displaying anything. I think the function set instruction isn't been written. Can somebody please check if I am approaching this the right way? I'll post my 8 bit code (which is working) and my 4 bit code (which I'm trying to get to work) //8 bit working COMPortC(0x3C); //function set Delay1KTCYx(10); COMPortC(0x0F)

Determine screen color depth in android

て烟熏妆下的殇ゞ 提交于 2019-12-12 02:29:59
问题 I'm trying to determine the color depth of the screen to convert some images to RGB565 if necessary. Any help is appreciated. Thanks 回答1: try getWindowManager().getDefaultDisplay().getPixelFormat() . See getPixelFormat(), PixelFormat 来源: https://stackoverflow.com/questions/11589607/determine-screen-color-depth-in-android

C++ Direct3D9 GetFrontBufferData with 16 bits color Depth

隐身守侯 提交于 2019-12-11 12:48:07
问题 I am currently developing a little screenshot application which records both of my screen's desktop in a file. I am using the GetFrontBufferData() function and it is working great. Unfortunately when changing the screen color depth from 32 to 16 bits (to perform some tests) I have a bad image (purple image with changed resolution) and the recorded screenshot has a very poor quality: Does someone know if there is a way to use GetFrontBufferData() with a 16 bits screen ? edit: My init direct3D:

C# - How to convert an Image into an 8-bit color Image?

倖福魔咒の 提交于 2019-12-02 06:15:12
I need to convert a PNG Image loaded from a file into an 8 bit-per-pixel byte array used by another device (embedded programming). I'm copying over pixel by pixel into a new Image created with a 16-bit color - Format16bppRgb565 , but I need Format8bpp , which is not present in the .NET Framework. (I cannot use Format8bppIndexed since the other device cannot handle indexed bitmaps) Bitmap img = new Bitmap(imgPath); Bitmap img8 = new Bitmap(imgW, imgH, PixelFormat.Format16bppRgb565); for (int I = 0; I <= img.Width - 1; I++) { for (int J = 0; J <= img.Height - 1; J++) { img8.SetPixel(I, J, img

Reducing color depth in an image is not reducin the file size?

こ雲淡風輕ζ 提交于 2019-11-29 16:49:38
I use this code to reduce the depth of an image: public void ApplyDecreaseColourDepth(int offset) { int A, R, G, B; Color pixelColor; for (int y = 0; y < bitmapImage.Height; y++) { for (int x = 0; x < bitmapImage.Width; x++) { pixelColor = bitmapImage.GetPixel(x, y); A = pixelColor.A; R = ((pixelColor.R + (offset / 2)) - ((pixelColor.R + (offset / 2)) % offset) - 1); if (R < 0) { R = 0; } G = ((pixelColor.G + (offset / 2)) - ((pixelColor.G + (offset / 2)) % offset) - 1); if (G < 0) { G = 0; } B = ((pixelColor.B + (offset / 2)) - ((pixelColor.B + (offset / 2)) % offset) - 1); if (B < 0) { B = 0