rgb

how to convert 16-bit RGB Frame Buffer to a viewable format?

余生颓废 提交于 2019-12-23 10:58:13
问题 I'm working with someone else's code on a device which can put an image to /dev/fb/0 and show up on video out or send it over the network to a client application. I don't have access to the old source for the client app, but I know the following about the data: 720x480 16-bit RGB (I'm no sure if it's 5,5,5 or 5,6,5) RAW (no headers whatsoever) cat -able to /dev/fb/0 675kb How can I give this a header or convert it to JPEG, BMP, or a RAW type that I could then view in a desktop application?

how to convert 16-bit RGB Frame Buffer to a viewable format?

折月煮酒 提交于 2019-12-23 10:58:10
问题 I'm working with someone else's code on a device which can put an image to /dev/fb/0 and show up on video out or send it over the network to a client application. I don't have access to the old source for the client app, but I know the following about the data: 720x480 16-bit RGB (I'm no sure if it's 5,5,5 or 5,6,5) RAW (no headers whatsoever) cat -able to /dev/fb/0 675kb How can I give this a header or convert it to JPEG, BMP, or a RAW type that I could then view in a desktop application?

Random Colors with preference

↘锁芯ラ 提交于 2019-12-23 10:09:03
问题 The idea: I am trying to simulate a shop system. By clicking on items the users shows that he is interested in stuff like that and gets more like it the next time he visits the website. I want to achieve something similar only without things to buy, but with colors. You get random colors. If you 'like' red colors you get random ones but more red than usual. So far in theory. Practically I made cookies for r,g and b with the starting values 1.0. Each time one of the colors is clicked the value

How can I know if the image is in RGB or BGR format?

岁酱吖の 提交于 2019-12-23 09:36:16
问题 Is there any way to know in advance if an image used as an input to a system is in RGB or BGR format? I am using opencv with java API and I would like to convert an input image into grayscale or L*a*b* color space, but in OpenCV you have to specify first whether the image you want to convert is in RGB or BGR. update : The type of the image I am using is either .jpg or .png 回答1: If your image is a BufferedImage then you can ask for his type with getType() , and test against the several

How to generate random pastel (or brighter) color in Javascript?

家住魔仙堡 提交于 2019-12-23 07:12:19
问题 I am building a simple website that gives a random quote when I click a button, and with that, the background color changes. The thing is that sometimes the background color is too dark and the font is black, and consequently the person can't read the quote. My question: Is there is any way to create a random color code using just bright colors , or pastel colors ? I got this code to generate a random color. I tried to edit to get only A to F strings but no success: '#'+((1<<24)*(Math.random(

Validate existance of RGB channels

你离开我真会死。 提交于 2019-12-23 05:32:06
问题 I'm looking over a number of images with missing aspects, namely missing either red, green or blue channels (which have been removed accidentally by an automated process before I was give the images). I need to fine the valid images. Is there a quick way of checking to see if an image has all three (R, G & B) channels? Alpha channels (if included) are ignored. I've been using PIL up until this for image processing in Python point (I realise it might not be the way forward). I've not tried

Image colors composition using R

谁说胖子不能爱 提交于 2019-12-23 04:06:15
问题 I'm trying to obtain the percentage of each color which compose a given picture. I get the RGB matrix using this code: library(jpeg) img <- readJPEG("C:/Users/Pictures/img.jpg") dim(img) #145 371 3 img<-img*255 #this operation is necessary to obtain an RBG scale At this step I'm not sure which is the right way to go ahead. Anyway, I would like to obtain someting like this: Count RGB vector 200614 (255,255,255) 4758 (253,253,218) 4312 (250,250,229) 1821 (235,237,242) 1776 (212,214,226) ... and

Drawing CGImageRef in YUV

偶尔善良 提交于 2019-12-23 03:33:08
问题 I am using the code here to convert a CGImageRef into a CVPixelBufferRef on OS X . Convert UIImage to CVImageBufferRef However, I need the image to be drawn in YUV (kCVPixelFormatType_420YpCbCr8Planar) instead of RBG as it is now. Is there anyway to directly draw a CGImage in YUV colorspace? And if not, does anyone have an example for the best way to go about converting the CVPixedBufferRef from RBG into YUV ? I understand the formulas for the conversion but doing it on the CPU is painfully

convert YUV422 to RGB24

痞子三分冷 提交于 2019-12-23 03:32:17
问题 I tried to write an YUV422 to RGB24 converter, but the result of the converted data seems to be strange. The result is a violet touched greyscale Picture with some light green dots... Does anyone has an idea? inline void convert_yuv442_2_rgb24(const unsigned char* source, unsigned char* destination, unsigned long width, unsigned long height) { unsigned char data[3]; for(unsigned long i = 0, c = 0; i < width * height * 2; i += 2, c += 3) { // 16Bit YUV422 -> 24Bit YUV data[0] = source[i+0];

How to get RGB values using JMagick?

倖福魔咒の 提交于 2019-12-23 01:53:18
问题 How to get RGB values using JMagick(a wrapper of imagemagick) ? 回答1: If you want to get the "red" value of a specific image, on the commandline, you could use the following syntax. For the JMagick API, just look up how you'll have to translate this into API calls: identify -format "%[fx:s.p{111,111}.r]" input.jpg 0.427451 fx: is ImageMagick's special effects image operator that allows you to query all sorts of properties from an image, use them in a mathematical expression and apply them on