简体   繁体   English

如何循环遍历多点选择的每个点来获取像素值?

[英]How to loop through each point of a multi point selection to get the pixel value?

I'm new to ImageJ and ImageJ macro.我是 ImageJ 和 ImageJ 宏的新手。 I started to make a macro that apply the "Find Maxima" function on an image.我开始制作一个在图像上应用“Find Maxima”function 的宏。 Then I would like to test each pixel spotted as maxima to filter them by value.然后我想测试每个被发现为最大值的像素以按值过滤它们。 How can I loop through all the points of the selection into my macro?如何将选择的所有点循环到我的宏中? Thanks谢谢

Finally I found an answer:最后我找到了答案:

threshold = 254;

getSelectionCoordinates(x, y);
     for (i=0; i<x.length; i++){
        if(getPixel(x[i], y[i]) < threshold){
            setKeyDown("alt");
            makePoint(x[i], y[i]);
        }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM