我具有以下launchSettings.json来构建我的项目,运行它并观察文件更改:
struct Params {
cv::Mat* src;
cv::Mat* dest;
};
void makeBrightness(int pos, void* data) {
Params* params = (Params*)data;
for (int i = 0; i < params->src->rows; i++) {
for (int j = 0; j < params->src->cols; j++) {
Vec3b pixelColor;
pixelColor = params->src->at<Vec3b>(Point(j, i));
for (int k = 0; k < 3; k++) {
if (pixelColor[k] + pos > 255)
pixelColor[k] = 255;
else
pixelColor[k] += pos;
params->dest->at<Vec3b>(Point(j, i)) = pixelColor;
}
}
}
imshow("Bright Image", *(params->dest));
}
int main()
{
int brightness_value = 25; //global values
const int max_value = 255;
Mat srcImage = cv::imread("D:/lena.jpg");
Mat brightImage;
srcImage.copyTo(brightImage);
namedWindow("Bright Image");
moveWindow("Bright Image", 300, 600);
Params params;
params.src = &srcImage;
params.dest = &brightImage;
createTrackbar("Brightness", "Bright Image", &brightness_value, max_value, makeBrightness, ¶ms);
makeBrightness(brightness_value, ¶ms); // for first painting your image
waitKey(0);
return 0;
不幸的是,似乎用Visual Studio调试器启动的dotnet无法检测到文件更改。这很奇怪,因为我在另一台机器上使用了相同的配置文件,并且可以正常工作,而且当我从终端手动启动运行dotnet watch时,它也可以正常工作。
无法检测到我的文件更改的Visual Studio会发生什么?