Friday, 18 March 2016

Summary of March 1st- Get RGB value of a picture

3.1
After I was able to take photos, I worked on getting RGB value of a picture.
I add these codes into the existed file.
This long block of codes is a function of Xcode. By restricting sampling point on each line and row, I can get certain number of pixel points’ RGB value. In my initial imagination, I can get total pixel points’ RGB value which is 1334*750. However in real test, even 250*250 will take a long time, so that it is difficult to process 1334*750 points in a short time. If the time is too long, this project will lose its value.


  float rowdimention = 250;
    float linedimention = 250;



Figure 1: Codes on get RGB value of a picture



Figure 2: Display an instruction if necessary 




After running these codes, it can print out RGB value of every single point of the picture! At the same time, it is able to count total red points in a picture. This is quite help to the next step, obtain the pixel width of red blocks in a picture.

Comments:
At that that time, I set the resolution to be 250 *250. In the later experiment, it is proved that this resolution is too low and I change it to be 625*425. At the beginning, I can’t get RGB of any points. I just tried to modify the codes to make it work. 

No comments:

Post a Comment