Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
When I'm reading an image its giving me values that are above 100 when it should be less, how do I retain the true values of the elements without changing the element values
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
This is the image I want to read, but when I read it the element closest to the black region should be 51 but instead im getting 153. Can someone help please, thank you.
0 commentaires
Réponses (2)
Walter Roberson
le 30 Jan 2017
In that image file, you have an obvious big white patch in the middle. Those values are up around 255. You also have a white frame around three sides of the image, approximate 251-254 range.
Other than that white spot, the light grey is the brightest part of the image, and in particular the part that is immediately beside the black outlining the light grey is brighter than the rest, with points reaching above 180.
The darker patch inside the light gray and above the white is approximately 80; the light grey would have to be darker than the dark patch if it were in the 60's.
I would guess, looking at the distribution of values, that the image was created from a CT dataset that was in the range -2048 to +2048, and that CT data was converted to the range 0 to 1 using something like mat2gray(), and then the 0 to 1 range was saved, with imwrite automatically converting the 0 to 1 range into 0 to 255. It is plausible that the area you mention was in the range of 64 in the original data scale.
4 commentaires
Walter Roberson
le 31 Jan 2017
You would have to know the original range of values, and you would have to know what range it was normalized over (which might have been only a subset of the origin range.) Though really, just knowing the range it was normalized over would work too.
Image Analyst
le 31 Jan 2017
What happened to the original image? Is it not still in a variable? How did you get it the first time? With imread()? Can't you do that again, if you don't still have it as a variable?
Image Analyst
le 30 Jan 2017
The original image was segmented somehow, perhaps by using imquantize or inbinarize - not sure. So that's when the values got changed, not upon reading that image back in from disk. If you want the original image, read back in the original image, not this processed one.
0 commentaires
Cette question est clôturée.
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!