How to detect all the pixel intensity values in a grayscale image and store them?
86 ビュー (過去 30 日間)
古いコメントを表示
I have a grayscale image wich has a very low contrast. I want to obtain the pixel intensity values of the entire image so that i can compare the background pixel intensity value to that of the object in the image. Can you please tell me how to obtain these pixel values and store them for my analysis?
5 件のコメント
採用された回答
Image Analyst
2020 年 1 月 9 日
編集済み: Image Analyst
2020 年 1 月 9 日
You can call impixelinfo() to let you see the gray levels as you mouse around over the image.
To get the gray level of the image at a particular location, just index it:
grayLevel = grayImage(row, column); % For a gray scale image.
rgbValues = rgbImage(row, column, :); % For a color image or gray scale image.
or you could use impixel()
pixelValue = impixel(yourImage); % where your image can be gray scale or color.
Also I'm attaching a script that converts an image into a CSV file where each column is [x, y, grayLevel] or [x, y, r, g, b]
2 件のコメント
Image Analyst
2020 年 1 月 9 日
It's not easy. It would be a project to do this robustly - not some 5 minute job I can do for you. I'd look into perhaps using the radon transform to determine the angle. You might also look into anisotropic diffusion to smooth/smear the image along the blobs to reduce noise and help distinguish the blobs better. Demos attached. You might also have to look at watershed segmentation to split apart touching blobs. See Steve's Image Processing Blog
Depending on how many images you have it might be better to just use human assisted analysis, like with imdistline() or ginput() or drawpoint() or something. It could be faster to do that than to program up some complicated algorithm that takes weeks. It just depneds on what is your goal. Is your goal to make measurements from your image, regardless of the method? Or is your goal the development of a new algorithm for these types of images? If you can make measurements for your sponsoring organization this week and get them their answers, is that preferable than telling them you'll need 6 months to develop a new robust algorithm? Would they want to wait, or just get it done even if it's maybe somewhat subjective?
その他の回答 (1 件)
Victoria Austin
2020 年 1 月 9 日
2 件のコメント
Image Analyst
2020 年 1 月 9 日
Just ry putting roipoly in a loop where, at the end of the loop, you call questdlg() to ask them if they want to draw any more.
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!