I need a way to assign a value for each pixel based on RGB values. which will be based on equations for red,blue and green
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
So for blue (0-255) it will have a value between 0 and 10 for green (0-255) it will have a value between 10 and 20 for red (0-255) it will have a value between 20 and 90. And when a pixel is selected I want get the value based on the equations based on the pixel's RGB values.
1 comentario
Geoff Hayes
el 26 de Feb. de 2018
Nasser - are you assigning one value for each pixel? How would you convert or assign the value for
(70, 140, 210) ---> (R, G, B)
What equations are you using to map (say) the 210 to a value between 0 and 10?
Respuestas (1)
Matt
el 26 de Feb. de 2018
Editada: Matt
el 26 de Feb. de 2018
The imread function in MATLAB does something like this. It will output a matrix with rows, columns (each element corresponding to a pixel) and 3 pages. Each page corresponds to a primary color present in the image: red, green and blue.
A = imread('ngc6543a.jpg');
imshow(A)
R = A(:,:,1);
G = A(:,:,2);
B = A(:,:,3);
figure
subplot(2,2,1)
imshow(R)
subplot(2,2,2)
imshow(G)
subplot(2,2,3)
imshow(B)
0 comentarios
Ver también
Categorías
Más información sobre Modify Image Colors en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!