rgb

How do I use Gimp / OpenCV Color to separate images into coloured RGB layers?

女生的网名这么多〃 提交于 2019-12-13 19:15:44
问题 I have a JPG image, and I would like to find a way to: Decompose the image into red, green and blue intensity layers (8 bit per channel). Colorise each of these now 'grayscale' images with its appropriate color Produce 3 output images in appropriate color, of each channel. For example if I have an image: dog.jpg I want to produce: dog_blue.jpg dog_red.jpg and dog_green.jpg I do not want grayscale images for each channel. I want each image to be represented by its correct color. I have managed

Pixel RGB values are all zero

夙愿已清 提交于 2019-12-13 18:07:43
问题 I want to iterate through pixels of canvas and get their colors as RGB but all pixels have 0,0,0 RGB value even though there is an image on canvas. Here is my code; (my test image is not seen in jsfiddle) http://jsfiddle.net/mwPfa/2/ for(i = 400; i < 1000; i += 4) { red = imageData.data[i]; green = imageData.data[i + 1]; blue = imageData.data[i + 2]; alpha = imageData.data[i + 3]; console.log(red + "," + green + "," + blue + "," + alpha); } 回答1: working example - http://jsfiddle.net/mwPfa/3/

How can I create a YUV422 frame from a JPEG or other image on Ubuntu

会有一股神秘感。 提交于 2019-12-13 11:50:12
问题 I want to create a sample YUV422 Frame on Ubuntu from any image so I can code a YUV422 to RGB888 function for the sake of learning. I'd really like to be able to use a trusted tool to create a sample and convert back to a jpeg. I've tried ImageMagick but am clearly doing something wrong: convert -size 640x480 -depth 24 test.jpg -colorspace YUV -size 640x480 -depth 16 -sampling-factor 4:2:2 tmp422.yuv convert -colorspace YUV -size 640x480 -depth 16 -sampling-factor 4:2:2 tmp422.yuv -size

imagemagick convert CMYK pdf to RGB jpeg or PNG and preseerve colors

佐手、 提交于 2019-12-13 11:34:05
问题 I have a cmyk pdf that I am trying to convert to a RGB jpeg or png file but have the colors stay pretty close to what the CMYK version is (compared to how photoshop does it) I am trying the following command but the colors change drastically from a red color to almost bright neon red and so on. Here is the command convert cmykpdf.pdf +profile icc -profile AdobeRGB1998.icc -colorspace sRGB jpegtesting.jpg Any ideas? or thoughts on how to do this. I tried saving it as a PNG also and same issue

Creating Image from Pixel Values

蓝咒 提交于 2019-12-13 10:54:12
问题 In java...I have an integer array of RGB pixels, means output of my program is as follows: ' Pixel 1: 255 200 191 231 Pixel 2: 255 237 028 036 Pixel 3: 255 034 177 076 Pixel 4: 255 085 140 066 Pixel 5: 255 200 191 231 Pixel 6: 255 237 028 036 Pixel 7: 255 231 188 167 Pixel 8: 255 237 028 036 Pixel 9: 255 237 028 036 Pixel 10: 255 063 072 204 Pixel 11: 255 226 125 144 Pixel 12: 255 063 072 204 Pixel 13: 255 200 191 231 Pixel 14: 255 062 187 099 Pixel 15: 255 255 127 039 Pixel 16: 255 255 127

How to know what r,g,b values to use for get other colours to paint a JFrame dynamically?

五迷三道 提交于 2019-12-13 10:43:03
问题 I want to know how to manage the rgb values to change the background colour of a JFrame dynamically, by now i can only change from green to blue and versa vice; this are the colours that i need: The rgb of these colours can be found here Here's my sample code of how to change from green to blue dynamically: import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import

How can I check if a pixel is green in a RGB image?

社会主义新天地 提交于 2019-12-13 08:06:58
问题 I'm using opencv and numpy to process some satellite images. I need to differentiate what is "land" from what is "green" (crops and vegetation). My question is: How can I decide which values are close to green in the RGB format? What I'm doing so far is: img = cv2.imread('image1.jpg',1) mat = np.asarray(img) for elemento in mat: for pixel in elemento: if pixel[1] > 200: # If the level of green is higher than 200, I change it to black pixel[0] = 0 pixel[1] = 0 pixel[2] = 0 else: # If the level

Converting from RGB to Lαβ Color spaces and converting it back to RGB using OpenCV

邮差的信 提交于 2019-12-13 07:16:30
问题 I am currently trying to convert colors between RGB (red, green, blue) color space and Lαβ color space, Based on the details in the this paper. My difficulties are in reversing the conversion process. When the result is not as same as initial RGB Mat. I think I missing something in type castings between Mats but I can't tell what is it! here is my code: <!-- language: lang-cc --> Mat DetectTrackFace::RGB2LAlphBeta(Mat &src) { Mat dest; Mat L_AlphBeta(src.rows, src.cols, CV_32FC3); //cvtColor

Create image from RGB data?

点点圈 提交于 2019-12-13 06:24:58
问题 I'm having real trouble with this. I have some raw rgb data, values from 0 to 255, and want to display it as an image on the iphone but can't find out how to do it. Can anyone help? I think i might need to use CGImageCreate but just don't get it. Tried looking at the class reference and am feeling quite stuck. All I want is a 10x10 greyscale image generated from some calculations and if there is an easy way to create a png or something that would be great. 回答1: a terribly primitive example,

How to extract Y,U, and V components from a given yuv file using Matlab? Each component is used for further pixels level manipulation

跟風遠走 提交于 2019-12-13 05:45:47
问题 Hey guys. I'm currently playing with YUV file. Do you have any suggestion on how to extract y,u,v components from a yuv video? I found a piece of program which was shown below. But I don't know which part is the valid components that I want. Thanks. % function mov = loadFileYuv(fileName, width, height, idxFrame) function [mov,imgRgb] = loadFileYuv(fileName, width, height, idxFrame) % load RGB movie [0, 255] from YUV 4:2:0 file fileId = fopen(fileName, 'r'); subSampleMat = [1, 1; 1, 1];