Single pixel event image processing in python -
i have had lonng term problem proceccing ccd image of xray source, attached hereccd image after theresholding arbitrary value, thing need subtract multi-pixel events image. need count number of pixels belongs single pixels.
*- multi pixel mean pixels has nonzero value in sorounding pixels.
i have code working using pil.image.open() read in list , analysis pixel pixel! i'm looking standard image prcessing routin more reliable , better results. appriciate if can give me how it.
cheers
you can quite imagemagick installed on linux distros , available osx , windows. there c/c++, python, perl, php, ,net , other bindings available. i'll @ command line here.
so, here start image:
first, let's threshold @ arbitrary 80%:
convert ccd.png -threshold 80% result.png
now let's find white pixels have no other white pixels around them:
convert ccd.png -threshold 80% -morphology hmt peaks:1.9 result.png
the technique "hit-and-miss morphology" , described here in anthony thyssen's excellent imagemagick usage pages. search on page "peak" find exact paragraph.
now let's count them:
convert ccd.png -threshold 80% -morphology hmt peaks:1.9 -format "%[fx:int(mean*w*h)]" info: 975
let's check multi-pixel events removed:
convert ccd.png -threshold 80% \( +clone -morphology hmt peaks:1.9 \) -compose difference -composite result.png
Comments
Post a Comment