How to plot plot Intensity vs pixel values using simulink xy graph?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I am using Simulink support package for Android to design an application. I need to get the grayscale intensity values from the live camera and plot it against the pixel count. I have used a MATLAB function to get grayscale intensity with R,G,B matrix from the camera. I need to plot the column vector grayIntensity (size: 1x720 due to the camera resolution) against the vector pixel_count. Is there any way to use the XY graph block to do this?
function [r_out, g_out, b_out,grayIntensity, pixel_count] = Grayscale(r_in,g_in, b_in)
%#codegen
%%Get RGB Color
r = r_in;
g = g_in;
b = b_in;
gray= (r+g+b)/3;
G = sum(gray)*0.004;
grayIntensity = G';
pixel_count=0:size(grayIntensity);
%% RGB output
r_out = uint8(r);
g_out = uint8(g);
b_out = uint8(b);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/278783/image.jpeg)
0 commentaires
Réponses (1)
Sutanu Maiti
le 24 Mar 2020
XY graph is not there for Android Deplpooyment.
But you can use Arrayplot block on Android device.
Please have a look at below example that plots signal on android screen:
Voir également
Catégories
En savoir plus sur Modeling dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!