Home > Enterprise >  Under Linux Clion in reading files can't use relative path
Under Linux Clion in reading files can't use relative path

Time:09-19

Code can Make through, directly use./method can run,
But to set breakpoints in clion found no read in data, must use the absolute path to run,
What reason is this excuse me? Clion need what Settings?

 
#include
#include

#include
#include
#include

using namespace std;
using namespace cv;

Const int g_nMaxAlphaValue=https://bbs.csdn.net/topics/100;
Int g_nAlphaValueSlide;
Double g_dAlphaValue;
Double g_dBetaValue;

Mat g_srcImage1;
Mat g_srcImage2;
Mat g_dstImage;

Void on_Trackbar (int, void *) {
G_dAlphaValue=https://bbs.csdn.net/topics/(double) g_nAlphaValueSlide/g_nMaxAlphaValue;
G_dBetaValue=https://bbs.csdn.net/topics/1.0 - g_dAlphaValue;

AddWeighted (g_srcImage1 g_dAlphaValue, g_srcImage2 g_dBetaValue, 0.0, g_dstImage);

Imshow (" Picture ", g_dstImage);
}

Int main () {

G_srcImage1=imread (" rain. JPG ");
G_srcImage2=imread (" mogu. JPG ");
if (! G_srcImage1. Data) {
Cout & lt; <"HERE2" & lt; return -1;
}
if (! G_srcImage2. Data) {
Cout & lt; <"HERE1" & lt; return -1;
}
NamedWindow (" Picture ");

G_nAlphaValueSlide=50;

CreateTrackbar (" Alpha ", "Picture", & amp; G_nAlphaValueSlide g_nMaxAlphaValue, on_Trackbar);

On_Trackbar (g_nAlphaValueSlide, 0);

WaitKey (0);
return 0;

return 0;
}

CodePudding user response:

The breakpoint is set on imread ();
Find two pictures are not read,

CodePudding user response:

In the Run/Edit Configurations in the modified Working directory


Or use chdir in the program

CodePudding user response:

Instead../can
  • Related