Created
December 26, 2018 22:53
-
-
Save SubhiH/bf12cdbbc88ffb96089a922e068c8d65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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