Skip to content

Instantly share code, notes, and snippets.

@SubhiH
Created December 26, 2018 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SubhiH/bf12cdbbc88ffb96089a922e068c8d65 to your computer and use it in GitHub Desktop.
Save SubhiH/bf12cdbbc88ffb96089a922e068c8d65 to your computer and use it in GitHub Desktop.
int main() {
cv::VideoCapture cam(0);
if (!cam.isOpened()) {
throw std::runtime_error("Error");
}
cv::namedWindow("Window");
while(true){
cv::Mat frame;
cam>>frame;
cv::resize(frame, frame,cv::Size(350,350));
cv::cvtColor(frame, output, CV_BGR2GRAY);
cv::imshow("bgr_frame", frame);
cv::imshow("gray_frame", output);
cv::Mat output_rotate (output.rows, output.cols, CV_8UC1);
ImageOperator::rotate(output.data,output.cols,output.rows,output.channels(),output_rotate.data);
cv::imshow("rotate 90deg", output_rotate);
ImageOperator::rotate(output_rotate.data,output.cols,output.rows,output.channels(),output_rotate.data);
cv::imshow("rotate 180deg", output_rotate);
if(cv::waitKey(30) >= 0) break;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment