如何在两个图像中解决这个问题的最简单方法是从两个栅格中提取值并进行相关性。我不确定此解决方案是否适合您的特定情况。你有什么“格式”的图像?(灰度,RGB,大小,分辨率......)。请提供更具体的细节。
R中的两个栅格用于演示:

图片A 的值:
x <- c(1.0,1.0,1.0,1.0,0.5,0.5,0.0,0.0,0.5,0.5,
2.0,2.0,1.5,1.5,1.0,1.0,0.5,1.0,1.0,1.0,
2.5,2.0,2.0,2.0,2.0,1.0,1.0,1.5,2.0,2.0,
2.5,3.0,3.0,3.0,2.5,2.0,2.0,2.0,2.5,2.5,
2.5,3.5,4.0,3.5,2.5,2.0,2.5,3.0,3.0,3.5,
2.5,3.5,3.5,2.5,2.0,2.5,3.0,3.5,4.0,3.5,
2.5,3.5,3.5,3.0,3.5,4.0,4.0,4.0,3.5,2.5,
2.5,3.5,4.0,4.0,3.5,3.5,3.0,3.0,2.5,2.0,
2.5,3.5,3.5,3.0,2.5,2.5,2.0,2.0,2.0,1.5,
2.0,3.0,2.5,2.0,2.0,1.5,1.5,1.5,1.0,1.0)
图片B的值:
y <- c(rep(1, times = 10),
rep(2, times = 6), 1, rep(2, times = 3),
rep(2, times = 10),
rep(3, times = 4), rep(2, times = 4), 3,3,
3,4,4,3,2,rep(3, times = 4), 4,
3,4,rep(3, times = 5), rep(4, times = 3),
3,4,3,3,3,4,4,4,3,3,
3, rep(4, times = 4), rep(3, times=4), 2,
3,3,4,3,3,3,rep(2, times = 4),
2,3,3,3,rep(2, times = 6))
创建数组 -> 将数组转换为栅格
x_array<-array(x, dim=c(10,10))
y_array<-array(y, dim=c(10,10))
x_raster<-raster(x_array)
y_raster<-raster(y_array)
设置调色板和绘图...
colors_x <- c("#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497",
"#ae017e","#7a0177","#49006a")
colors_y <- c("#fff7f3","#fcc5c0","#f768a1","#ae017e")
par(mfrow=c(1,2))
plot(x_raster, col = colors_x)
plot(y_raster, col = colors_y)
...这是相关性
cor(x,y)
Pearson's product-moment correlation
data: x and y
t = 21.7031, df = 98, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.8686333 0.9385211
sample estimates:
cor
0.9098219
也许有更专业的解决方案,但我认为这个解决方案非常健壮、简单和直接。
值得关注的链接:(用于ImageJ)
http://imagej.nih.gov/ij/plugins/intracell/index.html