pixelformat

cv::Mat detect PixelFormat

偶尔善良 提交于 2019-12-05 14:27:34
I'm trying to use pictureBox->Image (Windows Forms) to display a cv::Mat image (openCV). I want to do that without saving the Image as a file ('cause i want to reset the image every 100ms). I just found that topic here: How to display a cv::Mat in a Windows Form application? When i use this solution the image appears to be white only. I guess i took the wrong PixelFormat. So how do figure out the PixelFormat i need? Haven't seen any Method in cv::Mat to get info about that. Or does this depend on the image Source i use to create this cv::Mat? Thanks so far :) Here i took a screen. Its not

Check If Image Is Colored Or Not

时光毁灭记忆、已成空白 提交于 2019-12-05 13:04:28
I'm trying to figure out whether an image is colored or not. On this StackOverflow question, there's a reply that says that I should check the PixelFormat enum of the Image . Unfortunately, the reply isn't very clear to me. Is it safe to check whether the image.PixelFormat is different from PixelFormat.Format16bppGrayScale to consider that it is a colored image? What about the other values of the enumeration? The MSDN documentation isn't very clear... You can improve this by avoiding Color.FromArgb, and iterating over bytes instead of ints, but I thought this would be more readable for you,

What is PixelFormat.RGBX_888

左心房为你撑大大i 提交于 2019-12-05 10:02:17
As the title said, anyone know what is RGBX_8888 pixel format? and what is the difference with RGBA_8888? Is RGBA_8888 offers an alpha channel but RGBX_8888 does not? The android documentation does not give much information on this unfortunately. Thanks. RGBX means, that the pixel format still has an alpha channel, but it is ignored, and is always set to 255. Some reference: Blackberry PixelFormat (It is not android, however I guess that the naming conventions stay same across platforms.) The RGBX 32 bit RGB format is stored in memory as 8 red bits, 8 green bits, 8 blue bits, and 8 ignored

OpenGL texture upload: UNSIGNED_BYTE vs UNSIGNED_INT_8_8_8_8

耗尽温柔 提交于 2019-12-04 18:34:45
问题 I'm calling glTexSubImage2D. If my pixel format is GL_RGBA , then are the pixel types GL_UNSIGNED_BYTE and GL_UNSIGNED_INT_8_8_8_8 fully equivalent? Also, are these two pairs equivalent? Format = GL_RGBA, Type = GL_UNSIGNED_INT_8_8_8_8 Format = GL_BGRA, Type = GL_UNSIGNED_INT_8_8_8_8_REV I've tried reading the OpenGL spec and the GL_EXT_packed_pixels spec, but honestly I can't make head or tail of them. 回答1: The answers are No and No. You have to think about the byte order in your computer.

Confused about PixelFormat

妖精的绣舞 提交于 2019-12-04 08:04:29
问题 I'm confused about PixelFormat on Android. My device is Motorola Defy. I have two questions: On Android 2.3 getWindowManager().getDefaultDisplay().getPixelFormat() returns 4 what stands for RGB_565. As far as I know my device has 16M colors, that means 3 (or 4 with alpha channel) bytes per pixel: 2^(8*3) = 2^24 = 16M But RGB_565 format has 2 bytes (16 bits) per pixel, what stands for 65K colors: 2^(8*2) = 2^16 = 65K So, why getPixelFormat() doesn't return format with 3 (or 4 like RGBA) bytes

Confused about PixelFormat

一曲冷凌霜 提交于 2019-12-02 19:26:02
I'm confused about PixelFormat on Android. My device is Motorola Defy. I have two questions: On Android 2.3 getWindowManager().getDefaultDisplay().getPixelFormat() returns 4 what stands for RGB_565 . As far as I know my device has 16M colors, that means 3 (or 4 with alpha channel) bytes per pixel: 2^(8*3) = 2^24 = 16M But RGB_565 format has 2 bytes (16 bits) per pixel, what stands for 65K colors: 2^(8*2) = 2^16 = 65K So, why getPixelFormat() doesn't return format with 3 (or 4 like RGBA) bytes per pixel? Is it display driver problems or something? Can I set PixelFormat to RGBA_8888 (or analogue

BitmapImage from file PixelFormat is always bgr32

三世轮回 提交于 2019-12-02 05:15:00
问题 I am loading an image from file with this code: BitmapImage BitmapImg = null; BitmapImg = new BitmapImage(); BitmapImg.BeginInit(); BitmapImg.UriSource = new Uri(imagePath); BitmapImg.CacheOption = BitmapCacheOption.OnLoad; BitmapImg.CreateOptions = BitmapCreateOptions.IgnoreImageCache; BitmapImg.EndInit(); It works as expected except for the fact that no matter what kind of image I'm loading (24bit RGB, 8bit grey, 12bit grey,...), after .EndInit() the BitmapImage always has as Format bgr32.

BitmapImage from file PixelFormat is always bgr32

妖精的绣舞 提交于 2019-12-02 02:27:41
I am loading an image from file with this code: BitmapImage BitmapImg = null; BitmapImg = new BitmapImage(); BitmapImg.BeginInit(); BitmapImg.UriSource = new Uri(imagePath); BitmapImg.CacheOption = BitmapCacheOption.OnLoad; BitmapImg.CreateOptions = BitmapCreateOptions.IgnoreImageCache; BitmapImg.EndInit(); It works as expected except for the fact that no matter what kind of image I'm loading (24bit RGB, 8bit grey, 12bit grey,...), after .EndInit() the BitmapImage always has as Format bgr32. I know there have been discussions on the net, but I have not found any solution for this problem. Does

C# Why Bitmap.Save ignores PixelFormat of Bitmap?

陌路散爱 提交于 2019-12-01 07:35:39
I need to process and save images in their original bpp (1 - for BnW, 8 - for gray, 24 - color). After processing I always have 24bpp (due to processing with Aforge.Net). I pass original bpp to saving function and I'm using the next code for saving: private static Bitmap changePixelFormat(Bitmap input, PixelFormat format) { Bitmap retval = new Bitmap(input.Width, input.Height, format); retval.SetResolution(input.HorizontalResolution, input.VerticalResolution); Graphics g = Graphics.FromImage(retval); g.DrawImage(input, 0, 0); g.Dispose(); return retval; } When I pass: PixelFormat

C# Why Bitmap.Save ignores PixelFormat of Bitmap?

孤街醉人 提交于 2019-12-01 05:36:09
问题 I need to process and save images in their original bpp (1 - for BnW, 8 - for gray, 24 - color). After processing I always have 24bpp (due to processing with Aforge.Net). I pass original bpp to saving function and I'm using the next code for saving: private static Bitmap changePixelFormat(Bitmap input, PixelFormat format) { Bitmap retval = new Bitmap(input.Width, input.Height, format); retval.SetResolution(input.HorizontalResolution, input.VerticalResolution); Graphics g = Graphics.FromImage