Relative Content

Tag Archive for c++opencv

OpenCV/C++ not printing coodinates

I am planning to detect a orange table tennis ball using OpenCV in Visual Studio and make a table tennis machine. My plan is to print two continuous coordinates only once when each time the ball is moving toward the machine(to calculate other info).

why cv::waitKey(x) is not closing frame after x seconds?

#include<opencv2/imgcodecs.hpp> #include<opencv2/highgui.hpp> #include<string> int main() { std::string path = “wallpaperflare.jpg”; cv::Mat img=cv::imread(path); cv::imshow(“Frame”,img); cv::waitKey(5000); cv::VideoCapture cam(0); while (1) { cam.read(img); cv::imshow(“VideoFrame”,img); cv::waitKey(1); } return 0; } I opened the first frame “Frame” for 5 seconds, but the program didn’t close the frame after 5 seconds before proceeding with the next line. Instead after 5 secs […]

How to make an image black and white in opencv c?

Actually I’m a complete beginner in opencv and in native C++ concepts so please excuse me if my question is so simple. Basically I want to convert an image to Black&White by using native C for that. can anyone please help me to learn this concept ?