How to read each pixel size contribution in an image?
2 views (last 30 days)
Show older comments
Nimit Jain on 28 Jun 2016
Commented: Image Analyst on 1 Jul 2016
I tried to create a login in which I can read 256x256 image pixel by pixel and print the information of each pixel contributing in the size of the image.
Image Analyst on 1 Jul 2016
I'd help if I could, but honestly, I'm not sure what is wanted, so I don't know how to answer.
Muhammad Usman Saleem on 28 Jun 2016
this function read each pixel of your image
Please explain further. What is an "RGB concentration"? How does it take up size? You gave the example of 65000 pixels and 500 kb before, but that does not seem to have a relationship to RGB ?
Walter Roberson on 28 Jun 2016
If you use imfinfo() on the image file, then it might have a structure field named DigitalCamera . That will be the EXIF information if it is present at all. If it is, then it might have a field indicating the distance the camera's autofocus figures the target object was, perhaps named 'SubjectDistance', and it might have a field indicating the camera aperature, or it might have information about the focal length, possibly named 'FocalLength'. With those in hand, perhaps together with information from the camera manufacturer about the sensor size, you can use formulae similar to those shown at http://photo.stackexchange.com/questions/12434/how-do-i-calculate-the-distance-of-an-object-in-a-photo to calculate the real-world height of the target object.... if that is what you meant by "size".
Are you trying to calculate the relative proportions (or total number of pixels) of each color? If so then are you looking for exact matches, or is there a way of deciding if two colors are close enough that they should be counted as a single color?
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!