Mathematica Asked by xsk8rat on January 21, 2021
A convenient way to check the results of ComonentMeasurements
is to show the results using Epilog
. However, one of these features appears to have changed behavior in Version 12.
Usually this is used for an x-ray, CT image, or Ultrasound. For example localizing the center of the active volume in an ion chamber which would be placed in this cavity:
For this example, i am just creating an image that shows the behavior.
Here is an example of using the ComponentMeasurements
function to identify a simple disk in a black background and display the results of this function using HighlightImage
and Epilog
(which one might expect to be the same).
UseImage=Image[Graphics[{Black,Rectangle[{-10,-10},{10,10}],White,Disk[{0,0},1]}],ImageSize->200];
UseComp=ComponentMeasurements[UseImage,{"Centroid","Circularity","EquivalentDiskRadius"}][[All,2]];
UseComp=Select[UseComp,(0.9<#[[2]]<1.&)];
Grid[{{"Version 12",SpanFromLeft},{"HighlightImage","Epilog"},{HighlightImage[UseImage
,{Red,(Disk[#[[1]],#[[3]]]&)/@UseComp}
,ImageSize->200
]
,Show[UseImage
,Epilog->{Red,(Disk[#[[1]],#[[3]]]&)/@UseComp}
,ImageSize->200
]
}}]
Prior to version 12, the ComponentMeasurements
appeared to give the location of the components in units of something that matched the image.
In Version 12.1.1.0, the display functions have changed (larger images?) as has the behavior of Epilog
.
Is there and easy way to allow a uniform behavior between HighlightImage
and Epilog
?
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP