How to plot a graph between (R,G,B) values and pixel coordinate ?

37 views
Skip to first unread message

Hussain

unread,
Jul 8, 2017, 4:19:24 PM7/8/17
to MIT App Inventor Forum


I am developing an application which can find its applicability in many physics problems. For now, I want to plot a graph between the Green pixel intensity value vs the pixel coordinate. For simplicity I want to extract Green pixel information of the image in the canvas keeping the y coordinate fixed  (canvas height/2) in the middle by scanning along x coordinate using a timer. With the timer the application will determine the Green pixel intensity in each x coordinate and plot in the canvas simultaneously. But till now I have failed to fetch the pixel data in the y coordinate of the graph or unable to plot the same. This is not the first time that I am seeking help, I have got help in most of my research work from this platform regarding development of the required app and I do acknowledge everywhere. Please help me with this issue, this may help me a lot. 

Thanking you in advance.  

Regards,

Iftak







BluetoothArduino.aia

Juan Antonio

unread,
Jul 8, 2017, 5:28:34 PM7/8/17
to MIT App Inventor Forum
Hi Hussain,

I disable your Timer and enable my Clock1, then I add this code...


I get number color x pixel, example... -16456434


Then in this Spanish tutorial convert this number in RGB (in Spanish is RVA)


http://kio4.com/appinventor/20C_decimal_rva.htm



With number V (Verde) Green you can plot.


Perhaps this help for you


Regards.








BluetoothArduino_2.aia

Hussain

unread,
Jul 9, 2017, 10:54:34 AM7/9/17
to MIT App Inventor Forum
Dear Juan, thanks your code is working well in extracting the color values but I am not able to plot the dynamic color values with the variation in time interval. I am trying to place the dynamic color values as the y- axis but it is not working. Please again help me with this.
Regards,
Iftak   
Pixel_plot.aia

Juan Antonio

unread,
Jul 9, 2017, 3:43:38 PM7/9/17
to MIT App Inventor Forum
p51C_decimal_rva_plot.aia

Hussain

unread,
Jul 9, 2017, 4:22:43 PM7/9/17
to MIT App Inventor Forum
Thank you so much dear Juan. This is exactly what I intended to do. This may significantly help me in my work.
Regards,
Iftak
Reply all
Reply to author
Forward
0 new messages