Adding (blending) two images using OpenCV input error

asked 2017-08-15 00:11:23 -0600

System information (version)

  • OpenCV => 3.3 (natively compiled from source)
  • Operating System / Platform => Windows 10 - 64 Bit
  • Compiler => Visual Studio 2015

I was testing Adding (blending) two images using OpenCV sample but noticed that when I enter floating point data as " .1" or " 0.1" or "0.1f" or "0.1d", cin does not accept it and the code uses its initial value for alfa which is 0.5. At last I've tried scientific numbers such as "1e-10" and "9e-10" and it worked.

I've googled it but it seems it is regular input method for floating point numbers to use dot notation, so I guess it should be something wrong in this code!

Any Help would be appreciated.

edit retag flag offensive close merge delete

Comments

which code, please ?

berak gravatar imageberak ( 2017-08-15 02:43:04 -0600 )edit
1

You mean this code: You'll have to debug your code to check input . use std::cin.getline or other alternatives .

Ziri gravatar imageZiri ( 2017-08-15 03:10:33 -0600 )edit

sorry, cannot reproduce it. are you trying to run this "out of your ide" ? does running it from a plain cmd.exe make any difference ?

cin does not accept it

this sounds very, very weird.

berak gravatar imageberak ( 2017-08-15 03:23:09 -0600 )edit