rgb

How can I plot a image with (x,y,r,g,b) coordinates using ggplot2?

元气小坏坏 提交于 2019-12-21 19:42:26
问题 I have a data frame image.rgb , into which I have loaded the r,g,b value for each coordinate of an image (using the jpeg and reshape packages). It now looks like: > head(image.rgb) y x r g b 1 -1 1 0.1372549 0.1254902 0.1529412 2 -2 1 0.1372549 0.1176471 0.1411765 3 -3 1 0.1294118 0.1137255 0.1176471 4 -4 1 0.1254902 0.1254902 0.1254902 5 -5 1 0.1254902 0.1176471 0.1294118 6 -6 1 0.1725490 0.1372549 0.1176471 Now I want to plot this 'image' using ggplot2. I can plot a specific 'channel' (red

alpha + RGB -> ARGB?

爷,独闯天下 提交于 2019-12-21 13:41:10
问题 In as3, is there a utility or function to convert an RGB color (e.g. 0xFF0000) and an alpha value (e.g. .5) into a A 32-bit ARGB value? And from ARGB to RGB + alpha? Some explanation: a bitmapdata can take an ARGB value in its constructor, but filling shapes in sprites usually takes RGB values. I would like the aforementioned utilities to ensure colors match up. 回答1: var argb : int = (alpha<<24)|rgb; var rgb : int = 0xFFFFFF & argb; var alpha : int = (argb>>24)&0xFF; 回答2: A,R,G,B is a common

Camera frame yuv to rgb conversion using GL shader language

荒凉一梦 提交于 2019-12-21 06:08:08
问题 I am getting the camera frame from the android camera Preview Callback in Byte array and pass it to jni code. As we can't use byte in c++ so i am converting it to the integer array as follows: JNIEXPORT void JNICALL Java_com_omobio_armadillo_Armadillo_onAndroidCameraFrameNative( JNIEnv* env, jobject, jbyteArray data, jint dataLen, jint width, jint height, jint bitsPerComponent) { Armadillo *armadillo = Armadillo::singleton(); jbyte *jArr = env->GetByteArrayElements(data, NULL); int dataChar

need to create a webm video from RGB frames

旧城冷巷雨未停 提交于 2019-12-21 05:22:12
问题 I have an app that generates a bunch of jpgs that I need to turn into a webm video. I'm trying to get my rgb data from the jpegs into the vpxenc sample. I can see the basic shapes from the original jpgs in the output video, but everything is tinted green (even pixels that should be black are about halfway green) and every other scanline has some garbage in it. I'm trying to feed it VPX_IMG_FMT_YV12 data, which I'm assuming is structured like so: for each frame 8-bit Y data 8-bit averages of

Color detection opencv

自闭症网瘾萝莉.ら 提交于 2019-12-21 04:52:28
问题 Using opencv, can a detection of a certain colour(Between a certain range of rgb values) be carried out in an image or a video frame? 回答1: You need to the define the treshold in RGB, and process the pixels in the image (hopefully not the whole image but a smaller region of interest, maybe a moving foreground shape) that fit to the deffinition. Something similar to what is discussed here. I am understanding that you know the color(or colors) you want to detect a priori. I hope this helps. 回答2:

Mathematical conversion sRGB and AdobeRGB

混江龙づ霸主 提交于 2019-12-21 03:50:33
问题 It is very clear question, but I've done a lot of research and didn't find answer. StackOverflow question as this or this are about jpeg converting. This is about python build-in library. So, how to convert sRGB to AdobeRGB and vice versa??? I mean a mathematical function, that convert 3 bytes to 3 bytes. No jpges, and so on. Just mathematical function to convert colors using pen and paper. Yes, photoshop does it in fact and there are some strange online calculators, that show another result.

How is convolution done with RGB channel?

感情迁移 提交于 2019-12-21 03:35:28
问题 Say we have a single channel image (5x5) A = [ 1 2 3 4 5 6 7 8 9 2 1 4 5 6 3 4 5 6 7 4 3 4 5 6 2 ] And a filter K (2x2) K = [ 1 1 1 1 ] An example of applying convolution (let us take the first 2x2 from A) would be 1*1 + 2*1 + 6*1 + 7*1 = 16 This is very straightforward. But let us introduce a depth factor to matrix A i.e., RGB image with 3 channels or even conv layers in a deep network (with depth = 512 maybe). How would the convolution operation be done with the same filter ? A similiar

Convert RGB to YCbCr - C code

隐身守侯 提交于 2019-12-21 02:41:49
问题 I need to convert RGB to YCbCr for my final project and I trying to do this way (I'm programming in C): /* Autor: Vinicius Garcia * Data : 09.ago.2011 * * Função que converte um pixel RGB em YCbCr * * param : int R valor do pixel no canal red * param : int G valor do pixel no canal green * param : int B valor do pixel no canal blue * return: int* vetor de inteiros com os valores H, S e V calculados - nesta ordem */ int* converter_RGB_para_YCbCr(int R, int G, int B){ int* YCbCr = (int*) malloc

Which is most accurate way to distinguish one of 8 colors?

夙愿已清 提交于 2019-12-21 00:01:13
问题 Imagine we how some basic colors: RED = Color ((196, 2, 51), "RED") ORANGE = Color ((255, 165, 0), "ORANGE") YELLOW = Color ((255, 205, 0), "YELLOW") GREEN = Color ((0, 128, 0), "GREEN") BLUE = Color ((0, 0, 255), "BLUE") VIOLET = Color ((127, 0, 255), "VIOLET") BLACK = Color ((0, 0, 0), "BLACK") WHITE = Color ((255, 255, 255), "WHITE") I want to have a function, which gets a 3-tuple as a parameter (like (206, 17, 38)), and it should return the color which it is. For instance, (206, 17, 38)

how to convert a RGB color value to an hexadecimal value in C++?

我是研究僧i 提交于 2019-12-20 23:59:42
问题 In my C++ application, I have a png image's color in terms of Red, Green, Blue values. I have stored these values in three integers. How to convert RGB values into the equivalent hexadecimal value? Example of that like in this format 0x1906 EDIT: I will save the format as GLuint. 回答1: Store the appropriate bits of each color into an unsigned integer of at least 24 bits (like a long ): unsigned long createRGB(int r, int g, int b) { return ((r & 0xff) << 16) + ((g & 0xff) << 8) + (b & 0xff); }