rgb

Arduino State Machine

扶醉桌前 提交于 2019-12-13 05:28:14
问题 This is a cross-post from someone who answered my original question here. I'm not sure how to go about executing the 3 functions I'm after (as well as introducing even more than 3 in the future). I am simply trying to Fade/Blink the selected Colour of an RGB LED (and perhaps introduce more functions in the future) where its RGB data is coming back from iOS and sent to an RFDuino BLE module. Sends a "fade" string to the module picked up by RFduinoBLE_onReceive (char *data, int len) on the

Image from RGB To Cmyk in php

北慕城南 提交于 2019-12-13 05:12:14
问题 I've some problem with php and imagick, i want to convert some image from rgb system to cmyk, but i've only black/or non background nothing else. $icc_cmyk = file_get_contents('USWebUncoated.icc'); $img->profileImage('icc', $icc_cmyk); $img->setImageColorspace(12); if ($php_vs < 5.3) { //ADJUST GAMMA BY 20% for 5.2.x $img->levelImage(0, 2.0, $range['quantumRangeString']); } else { //php 5.3 hack FOR INVERTED COLORS $img->negateImage(false, Imagick::CHANNEL_ALL); } $img->stripImage(); //$img-

Convert RGB image to RGB 16-bit and 8-bit

我的未来我决定 提交于 2019-12-13 05:08:00
问题 I'm a newbie programmer. Is there any algorithm to convert an image to 16-bit or 8-bit? I didn't find it on google, I'am desperate. 回答1: Changing to 16 bit is the easier one. Assuming that the original image is in image , you can simply draw it into the result. Bitmap result = new Bitmap(image.Width, image.Height, PixelFormat.Format16bppRgb565); using (Graphics g = Graphics.FromImage(result)) { g.DrawImage(image, 0, 0, image.Width, image.Height); } Unfortunately, this does not work for

Polarizing an image--how to find the average of each RGB value

故事扮演 提交于 2019-12-13 05:00:43
问题 For an exercise in image processing, I have to write a program that applies various effects to images. One of the effects was grayscale, which was done find the average of RGB values ((red+green+blue)/3). To polarize an image, however, I need to first find the averages of each individual component (i.e. all red values/number of red pixels). Would it be appropriate to then loop through the rows and columns (with a counter for pixels, red values, green values, and blue values) as a way to find

How to remove all color except a certain rgb value

耗尽温柔 提交于 2019-12-13 04:55:56
问题 Okay I need to get the program to scan the screen for a certain rgb value then change it to bright pink. I made the program and so far it scans the screen for a certain color. I do not know how to get it to change the pixel color. I think I need to upload a picture instead of having it scan the screen. But if I do that I still wouldn't know how to change the pixels. Here's my code so far. import java.awt.AWTException; import java.awt.Rectangle; import java.awt.Robot; import java.awt.Toolkit;

Translating Obj-C RGBtoHSV() function to Swift. min = MIN( r, MIN(g, b )); etc

柔情痞子 提交于 2019-12-13 04:53:09
问题 Could someone please help me with this function? This function is inside of a camera app that uses a filter algorithm to detect differences in colour variants etc. The syntax is very difficult for me. I don't know how to deal with the pointers in the arguments, the min and max variable syntax, what is delta etc? Could someone please translate for me? Much appreciated. Also should I be doing something with UIColor? Someone mentioned it below. I have no idea how to convert though. // r,g,b

Video from pipe->YUV with libAV->RGB with sws_scale->Draw with Qt

孤者浪人 提交于 2019-12-13 04:23:17
问题 I need to decode video from pipe or socket, then convert it set of images and draw with Qt(4.8.5!!). I'm using default example of libAV and adding to it what i need. Here is my code: AVCodec *codec; AVCodecContext *codecContext= NULL; int frameNumber, got_picture, len; FILE *f; AVFrame *avFrame, *avFrameYUV, *avFrameRGB; uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; AVPacket avpkt; av_init_packet(&avpkt); f = fopen("/tmp/test.mpg", "rb"); if (!f) { fprintf(stderr, "could not open

Determine illuminance from RGB image

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 03:44:21
问题 Is there a way to use camera (web camera or phone camera) as a light meter? Phone camera can grab image and get data in RGB format, but has anyone tried to determine illuminance value (in lux)? I am aware that there is no formula to do this (correct me if I am wrong), but is it possible to model it, and get an approximate value of illuminance? 回答1: The problem you would have, as all reflective light meters do, is that you can't tell the difference between a bright light (high lux) shining on

PNG RGB transformation related to alpha in getImageData?

核能气质少年 提交于 2019-12-13 03:44:16
问题 I have a PNG image with some pixels having an alpha of 254. These pixels have this color : RGBA{183, 221, 129, 254} (not a javascript notation). I can check in Gimp that the R, G and B components are 183, 221 and 129. But when I read my pixels in Chrome using getImageData (on a canvas) the R, G and B values are modified to 182, 220 and 128 (A being correctly 254). Is that a standardized transformation or a bug ? If that's normal, where can I find the exact formula to predict RGB values given

MATLAB: Show colorbar of a grayscale image in a figure containing a RGB image

本小妞迷上赌 提交于 2019-12-13 03:38:05
问题 Suppose we have two images: 1) RGB Image: % initialize RGB image: rgbIm = zeros(100, 100, 3); rgbIm(20:80, 20:80, 1) = 1; 2) Grayscale Image: % initialize grayscale image: grayIm = zeros(100); grayIm(20:80, 20:80) = 1; Lets show both of them: figure, imshow(rgbIm), colormap('jet'), colorbar; figure, imshow(grayIm), colormap('jet'), colorbar; As we can see, the colorbar in the 2nd figure (i.e. grayscale image) makes total sense. On the other hand I can't really understand the information given