I am working in digital image processing field, i have set of mammogram images in .bmp format, when i am opening anyone image using MATLAB then i am getting intensity value as 0 for a particular location (i,j), but when i am opening this image from java program using BufferedImage then i am getting intensity value as 59 for same location (i,j). Please tell what is reason behind it.

  • 3
    $\begingroup$ Maybe because Java uses 0-based indexing while matlab uses 1-based indexing? Anyway, I doubt this question is suitable for this site. $\endgroup$ – pichenettes May 10 '13 at 7:48

Many possibilities -

Color image, in which case you have three indices in MATLAB, e.g. I(i,j,k) where k is 1, 2 or 3

0-based vs 1-based indexing. First pixel is I(1,1) in MATLAB, I(0,0) in Java

MATLAB indexes by row then column, BufferedImage's getRGB function does column (x) then row (y)

I suggest starting at (1,1) and getting them to match. Then try (1,2) and (2,1).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.