Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Error left operand must be l-value

Hi, please help.

I got an error while building my program: "error C2106: '=' : left operand must be l-value". Actually i want to assign first pixel of Output_image with first pixel of 3x3 Gaussian mask, then second pixel of Output_image with second pixel of 5x5 Gausssian mask and so on. I figure that the problem come from the line [int(outputimage.at<uchar>(x,y)) = int(image_3.at<uchar>(x,y))] for the program shown below:

cv::GaussianBlur(image,image_3,cv::Size(3,3),0,0); cv::GaussianBlur(image,image_5,cv::Size(3,3),0,0);

for(int x=0; x<image_height; x++)="" for(int="" y="0;" y<image_width;="" y++)="" {="" if(y%2="=0)" int(output_image.at<uchar="">(x,y)) = int(image_3.at<uchar>(x,y)); else if (y%2==1) int(Output_image.at<uchar>(x,y)) = int(image_5.at<uchar>(x,y)); } Is it correct for me to assign [int(Output_image.at<uchar>(x,y)) = int(image_3.at<uchar>(x,y))]? Please advise me on how to solve the above error.

Thamk you very much.

click to hide/show revision 2
No.2 Revision

Error left operand must be l-value

Hi, please help.

I got an error while building my program: "error C2106: '=' : left operand must be l-value". Actually i want to assign first pixel of Output_image with first pixel of 3x3 Gaussian mask, then second pixel of Output_image with second pixel of 5x5 Gausssian mask and so on. I figure that the problem come from the line [int(outputimage.at<uchar>(x,y)) = int(image_3.at<uchar>(x,y))] for the program shown below:

cv::GaussianBlur(image,image_3,cv::Size(3,3),0,0);
cv::GaussianBlur(image,image_5,cv::Size(3,3),0,0);

cv::GaussianBlur(image,image_5,cv::Size(3,3),0,0); for(int x=0; x<image_height; x++)="" for(int="" y="0;" y<image_width;="" y++)="" {="" if(y%2="=0)" int(output_image.at<uchar="">(x,y)) x++) for(int y=0; y<image_width; y++) { if(y%2==0) int(Output_image.at<uchar>(x,y)) = int(image_3.at<uchar>(x,y)); else if (y%2==1) int(Output_image.at<uchar>(x,y)) = int(image_5.at<uchar>(x,y)); }

Is it correct for me to assign [int(Output_image.at<uchar>(x,y)) = int(image_3.at<uchar>(x,y))]? Please advise me on how to solve the above error.

Thamk you very much.