我想自动计算这种类型图像中斑点彼此非常接近的斑点数量,以便将许多斑点视为单个斑点:
我想过使用MATLAB的局部最大值函数/算法,imregionalmaxima但这会返回具有最大值的像素数(二进制矩阵中的像素数).我只想测量黑色循环中包含的白点数.
我在这里也找到了这个主题:如何计算此图像中的斑点数量?并使用ImageJ软件.它无法检测到斑点,在我看来它也检测到具有最大值的像素.
我想从控制台应用程序中读取一个字符串并进行比较:
#include "string.h"
#include "stdio.h"
#include "stdafx.h"
char* answer;
int _tmain(int argc, _TCHAR* argv[])
{
printf("(yes/no):");
scanf("%s", &answer);
if (answer=="yes")
{
printf("Yes");
}
else
{
printf("Exiting...");
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
Exiting...我放的时候总是收到消息yes.我怎么可能读到正确的值,yes但比较没有检测到 - answer=="yes"- ?
还试过这个:
#include "string.h"
#include "stdio.h"
#include "stdafx.h"
char answer[100];
int _tmain(int argc, _TCHAR* argv[])
{
printf("(yes/no):");
scanf("%s", answer);
if (!strcmp(answer,"yes"))
{
printf("Yes");
}
else
{
printf("Exiting...");
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
这使我成为第二个选择"Exiting...".这里有什么错误?