How to read each pixel size contribution in an image?

3 ビュー (過去 30 日間)
Nimit Jain
Nimit Jain 2016 年 6 月 28 日
コメント済み: Image Analyst 2016 年 7 月 1 日
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.
Please help
  8 件のコメント
Image Analyst
Image Analyst 2016 年 7 月 1 日
I'd help if I could, but honestly, I'm not sure what is wanted, so I don't know how to answer.

サインインしてコメントする。

回答 (2 件)

Muhammad Usman Saleem
Muhammad Usman Saleem 2016 年 6 月 28 日
this function read each pixel of your image
myimage=imread('youimage.jpg');
  2 件のコメント
Walter Roberson
Walter Roberson 2016 年 6 月 30 日
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
Walter Roberson 2016 年 6 月 28 日
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".
  2 件のコメント
Walter Roberson
Walter Roberson 2016 年 6 月 30 日
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?

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by