rgb

Camera2 API Set Custom White Balance & Temperature Color

三世轮回 提交于 2019-12-17 19:11:52
问题 I'm trying to set a custom value for the White Balance & temperature color in my camera app. I'm using camera2 API and I'm trying different ways to set this value. I found a method from a excel file to get the right RGB Temperature matrix [Red,Green,Blue] from the White Balance Value between 100 and 100.000. I attached this method to a Seekbar and its working fine, my problem appear when I try to focus something white, then it becomes pink. Any kind of light looks like a pink torch in the

To convert only black color to white in Matlab

两盒软妹~` 提交于 2019-12-17 18:42:06
问题 I know this thread about converting black color to white and white to black simultaneously. I would like to convert only black to white. I know this thread about doing this what I am asking but I do not understand what goes wrong. Picture Code rgbImage = imread('ecg.png'); grayImage = rgb2gray(rgbImage); % for non-indexed images level = graythresh(grayImage); % threshold for converting image to binary, binaryImage = im2bw(grayImage, level); % Extract the individual red, green, and blue color

regex javascript to match both RGB and RGBA

青春壹個敷衍的年華 提交于 2019-12-17 16:58:48
问题 Currently I have this regex which matches to an RGB string. I need it enhanced so that it is robust enough to match either RGB or RGBA. rgbRegex = /^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/; //matches RGB http://jsfiddle.net/YxU2m/ var rgbString = "rgb(0, 70, 255)"; var RGBAString = "rgba(0, 70, 255, 0.5)"; var rgbRegex = /^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/; //need help on this regex //I figure it needs to be ^rgba?, and then also an optional clause to handle the opacity var partsRGB = rgbString.match

Convert a raw negative rgb int value back to a 3 number rgb value

你说的曾经没有我的故事 提交于 2019-12-17 16:37:34
问题 Ok so I'm working on a program that takes in an image, isolates a block of pixels into an array, and then gets each individual rgb value for each pixel in that array. When I do this //first pic of image //just a test int pix = myImage.getRGB(0,0) System.out.println(pix); It spits out -16106634 I need to get the (R, G, B) value out of this int value Is there a formula, alg, method? 回答1: The BufferedImage.getRGB(int x, int y) method always returns a pixel in the TYPE_INT_ARGB color model. So

How to get pixel data from an image using R

跟風遠走 提交于 2019-12-17 15:59:13
问题 Can anyone help me on how to get the RGB pixel data from an image in R? I need this information to compare differences in bird plumage to aid in the understanding of a speciation event. My photos are taken by a digital camera and are now as a NEF-file. It doesn't matter which type of file that's needed, I have the possibility to convert the file to whatever I want. However, I would prefer to maintain as much information as possible in the file (i. e. PNG-files are good). I have tried many

How to pack ARGB to one integer uniquely?

不想你离开。 提交于 2019-12-17 15:50:13
问题 I have four integer values (0 - 255) for an ARGB color map. Now I want to make a unique float or integer of these four integers. Is it possible to do it like the following? sum = 4 * 255 + A; sum += 3 * 255 + R; sum += 2 * 255 + G; sum += 1 * 255 + B; Is the value really unique? 回答1: You are trying to do a base convert or something of that sort. Anyway the logic is like in base converting. 4 bytes = 32 bit. So 32 bit unsigned integer would do well. In this case, you have: ARGB = A<<24 + R<<16

PHP allocate color without image resource

北慕城南 提交于 2019-12-17 14:54:35
问题 Can you allocate a color in PHP GD without an image resource? It should be possible because really an allocated color is a number, right? $im = imagecreatetruecolor(100, 100); $col = imagecolorallocate($im, 255, 0, 0); print $col."<br/>"; $col2 = imagecolorallocate($im, 255, 0, 0); print $col2."<br/>"; $im2 = imagecreatetruecolor(600, 100); $col3 = imagecolorallocate($im, 255, 0, 0); print $col3; This prints out: 16711680 16711680 16711680 I guess what the real question is how 255, 0, and 0

Understanding BufferedImage.getRGB output values

a 夏天 提交于 2019-12-17 10:52:51
问题 I'm getting an integer value for the pixel in an image using this method: int colour = img.getRGB(x, y); Then I'm printing out the values and I see that black pixels correspond to a value like "-16777216", a kind of blue to something like "-16755216", etc. Can someone please explain me the logic behind this value? 回答1: getRGB(int x, int y) return you the value of color pixel at location (x,y) . You are misinterpreting the returned value. It is in the binary format. like 11...11010101 and that

Getting pixel data from an image using java

感情迁移 提交于 2019-12-17 10:24:09
问题 I'm trying to get the pixel rgb values from a 64 x 48 bit image. I get some values but nowhere near the 3072 (= 64 x 48) values that I'm expecting. I also get: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds! at sun.awt.image.ByteInterleavedRaster.getDataElements(ByteInterleavedRaster.java:301) at java.awt.image.BufferedImage.getRGB(BufferedImage.java:871) at imagetesting.Main.getPixelData(Main.java:45) at imagetesting.Main.main(Main.java:27) I

Generating gradients programmatically?

孤街浪徒 提交于 2019-12-17 10:18:38
问题 Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is this blog entry, but the example code seems to be missing, or at least it was as of this posting. Anything helps, algorithms, code examples, whatever. This will be written in Java, but the display layer is already taken care of, I just need to figure out how to figure out what to display. 回答1: you want an