pixel

swscaler warning : deprecated pixel format used

烂漫一生 提交于 2019-12-03 03:13:06
I want to perform a color space conversion of my video frame before converting it to an opengl texture with the following code: struct SwsContext * pSwsCtx = sws_getCachedContext(NULL,width, height, codec->pix_fmt, width, height, AV_PIX_FMT_RGBA, SWS_POINT, NULL, NULL, NULL); Each time the sws_getCachedContext() function is called I got the following warning: [swscaler @ 0x10506fa00] deprecated pixel format used, make sure you did set range correctly Here is my ffmpeg output for version information: ffmpeg version 2.2 Copyright (c) 2000-2014 the FFmpeg developers built on Mar 26 2014 15:29:01

D3D11: How to draw a simple pixel aligned line?

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried to draw a line between two vertices with D3D11. I have some experiences in D3D9 and D3D11, but it seems to be a problem in D3D11 to draw a line, which starts in one given pixel and ends in an other. What I did: I added 0.5f to the pixel coordinates of each vertex to fit the texel-/pixel coordinate system (I read the Microsoft pages to the differeces between D3D9 and D3D11 coordinate systems): f32 fOff = 0.5f; ColoredVertex newVertices[2] = { { D3DXVECTOR3(fStartX + fOff, fStartY + fOff,0), vecColorRGB }, { D3DXVECTOR3(fEndX + fOff,

Jet colormap to grayscale

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a jet colormap: and I would like to know if there's some way to convert to a grayscale. I can't use average because maximum and minimum value goes to the same gray color. Or if there's some way to convert to another color palette. I can't find on Google a function to convert it. MATLAB uses some thing called rgb2ind but I would like to know the formula. 回答1: First let me create an indexed image using the Jet colormap: img = repmat(uint8(0:255), 100, 1); cmap = jet(256); imshow(img, 'Colormap',cmap) The straightforward conversion using

Android ImageReader get NV21 format?

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I do not have a background in imaging or graphics, so please bear with me :) I am using JavaCV in one of my projects. In the examples , a Frame is constructed which has a buffer of a certain size . When using the public void onPreviewFrame(byte[] data, Camera camera) function in Android, copying this data byte array is no problem if you declare the Frame as new Frame(frameWidth, frameHeight, Frame.DEPTH_UBYTE, 2); where frameWidth and frameHeight are declared as Camera.Size previewSize = cameraParam.getPreviewSize(); int frameWidth =

Getting pixel format from CGImage

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I understand bitmap layout and pixel format subject pretty well, but getting an issue when working with png / jpeg images loaded through NSImage let nsImage:NSImage = NSImage(byReferencingURL: …) let cgImage:CGImage = nsImage.CGImageForProposedRect(nil, context: nil, hints: nil)! let bitmapInfo:CGBitmapInfo = CGImageGetBitmapInfo(cgImage) Swift.print(bitmapInfo.contains(CGBitmapInfo.ByteOrderDefault)) // True My kCGBitmapByteOrder32Host Does anybody knows what's going on? Surely the system somehow knows how do deal with this, since pngs are

swscaler warning : deprecated pixel format used

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to perform a color space conversion of my video frame before converting it to an opengl texture with the following code: struct SwsContext * pSwsCtx = sws_getCachedContext(NULL,width, height, codec->pix_fmt, width, height, AV_PIX_FMT_RGBA, SWS_POINT, NULL, NULL, NULL); Each time the sws_getCachedContext() function is called I got the following warning: [swscaler @ 0x10506fa00] deprecated pixel format used, make sure you did set range correctly Here is my ffmpeg output for version information: ffmpeg version 2.2 Copyright (c) 2000-2014

Grab Mac OS Screen using GL_RGB format

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using the glgrab code to try and grab a full-screen screenshot of the Mac screen. However, I want the bitmap data to be in the GL_RGB format. That is, each pixel should be in the format: 0x00RRGGBB The original code specified the GL_BGRA format. However, changing that to GL_RGB gives me a completely blank result. The total source code I'm using is: CGImageRef grabViaOpenGL(CGDirectDisplayID display, CGRect srcRect) { CGContextRef bitmap; CGImageRef image; void * data; long bytewidth; GLint width, height; long bytes; CGColorSpaceRef

IplImage Pixel Access JavaCV

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to access Pixel by Pixel of an IplImage. Im using Java and Processing, and sometimes I need to access pixel by pixel. I've done this so far, but I don't know what's wrong: public IplImage PImageToIplImage(PImage imageSrc) { IplImage imageDst; if(imageSrc.format==RGB) { imageDst = IplImage.create(imageSrc.width, imageSrc.height, IPL_DEPTH_8U, 3); ByteBuffer imagePixels=imageDst.getByteBuffer(); int locPImage, locIplImage, x, y; for(y=0; y<imageSrc.height; y++) for(x=0; x<imageSrc.width; x++) { locPImage = x + y * width; locIplImage

Changing pixel color Python

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am suppose to get an image from my fluke robot and determine the color of each pixel in my image. Then if the pixel is mostly red, change it to completely green. If the pixel is mostly green, change it to completely blue. If the pixel is mostly blue, change it to completely red. This is what I am able to do, but I can't get it to work to get the image I have to change. There is no syntax error, it is just semantic I am having trouble with. I am using python. My attempted code: import getpixel getpixel.enable(im) r, g, b = im.getpixel(0,0)

Ems to Pixel Conversion - Why 62.5% and not 6.25%?

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I know that a lot of us are familiar with setting the font size on the body element in our CSS to 62.5%. This means that 1em will equal 10px and helps for keeping things pixel perfect but also allows for scaling of fonts. So wouldn't that mean that setting it to 6.25% would equate to 1em = 1px? Seems like an even simpler conversion rather than having to mess with decimals... Thanks guys! I'm quite aware of the em and it's history (design degree), but I'm sure others may find it helpful :) As far as the 1em = 1px, I don't see how this is