Reading Images in Matlab like ImageJ
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello, currently I am reading (only) images with Miji (ImageJ) because ImageJ does all the treatment necessary to work with the images after (rgb2gray, etc). When I try to do it with imread it doesn't work. The values of some functions do not match, it's like the image doesn't have the same values as when it is read with ImageJ. One image stays the same and the calculations are well, and I only have to use rgb2gray but the rest of the images give me strange results, like negative positions. Can someone tell me if there is a way do read images in matlab like imagej does?
댓글 수: 0
답변 (1개)
Image Analyst
2014년 12월 16일
Attach your image, and give an example of one row and column location that does not have the same values in both programs. Neither imread() nor rgb2gray() gives positions, much less negative positions, so I don't know what you're trying to explain with that statement.
The formula that MATLAB gives for conversion of RGB to gray scale is gray = 0.2989 * R + 0.5870 * G + 0.1140 * B. What is the formula ImageJ uses? Accordint to it's web page, it's this: "RGB images are converted to grayscale using the formula gray=(red+green+blue)/3 or gray=0.299red+0.587green+0.114blue if "Weighted RGB to Grayscale Conversion" is checked in Edit>Options>Conversions." so it's the same formula as MATLAB.
So the only way to resolve this is for you to upload an image that gives different values in each program. Use the paper clip icon.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!