OpenCV

How do I take an Screenshot of my camera on EMGUCV 3.1?

这一生的挚爱 提交于 2021-01-29 05:30:52
问题 I'm doing a very simple program on EMGU CV, so I need to take a screenshot of what my camera is recording and save it in a specific folder, here follows my code of camera capture: ImageViewer viewer = new ImageViewer(); VideoCapture capture = new VideoCapture(); Application.Idle += new EventHandler(delegate (object sender, EventArgs e) { viewer.Image = capture.QueryFrame(); }); viewer.ShowDialog(); I apologize for the simple terms, I still really noob in programming. 回答1: It seems like you

Opencv.js How to draw a subset of contours?

≯℡__Kan透↙ 提交于 2021-01-29 05:16:30
问题 Using Opencv.js I have acquired the contours in an image. using some selection function I have collected a subset of these contours. Say they are in the list of contours: var suitableContours = []; I need to know draw these contours using opencv. If this were python I could do cv.drawContours(img, [suitableContours[cnt]], 0, [255, 0, 0, 255], 2); Assume by the point I want to draw the contours I don't have access to the original image nor the mask nor the original contour list, only the

Opencv.js How to draw a subset of contours?

﹥>﹥吖頭↗ 提交于 2021-01-29 05:08:40
问题 Using Opencv.js I have acquired the contours in an image. using some selection function I have collected a subset of these contours. Say they are in the list of contours: var suitableContours = []; I need to know draw these contours using opencv. If this were python I could do cv.drawContours(img, [suitableContours[cnt]], 0, [255, 0, 0, 255], 2); Assume by the point I want to draw the contours I don't have access to the original image nor the mask nor the original contour list, only the

Qt Creator Error: cannot find -lopencv_imgcodecs

人走茶凉 提交于 2021-01-29 05:03:50
问题 I have installed opencv, qt, qt creator, cmake on ubuntu 15.10 through VMware on windows. The opencv is installed in this directory: /home/majidalaeinia/opencv/ The project repository is cloned in this directory: /home/majidalaeinia/Desktop/imgwarp-opencv/ I want to run the project through its CMakeLists.txt in qt creator and when I press Build now on qt creator, I get the following errors: error: cannot find -lopencv_imgcodecs error: collect2: error: ld returned 1 exit status Where is the

error: namespace “cv::cuda” has no member “resize”

核能气质少年 提交于 2021-01-29 04:08:50
问题 I have successfully built opencv with WITH_CUDA=on . but I'm still facing this error error: namespace "cv::cuda" has no member "resize" . it is weird that the IDE suggests me that there is a resize function in that namespace but it fails on compile. Does anyone know how to tackle this matter? #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/video/background_segm.hpp" #include "opencv2/video/tracking.hpp" #include "opencv2/cudev/ptr2d/gpumat.hpp" #include

OpenCV symbols are undefined using gcc 5.1

筅森魡賤 提交于 2021-01-29 02:40:21
问题 I have a very basic program to test that OpenCV works. #include <opencv2/opencv.hpp> int main() { cv::namedWindow("Window", CV_WINDOW_AUTOSIZE); cv::VideoCapture video_capture; video_capture.open(0); while (true) { cv::Mat image; video_capture.read(image); cv::imshow("Window", image); if (cv::waitKey(1) == 27) { break; } } return 0; } And a CMakeLists.txt file that finds OpenCV like so: find_package(OpenCV REQUIRED) ... target_link_libraries(Project ${OpenCV_LIBS}) This works on Mac OSX 10.10

Apply cv2.boundingRect on np.array

风格不统一 提交于 2021-01-29 02:39:15
问题 How to apply cv2.boundingRect to a np.array of points ? The following code produces an error. points = np.array([[1, 2], [3, 4]], dtype=np.float32) import cv2 cv2.boundingRect(points) Error: OpenCV Error: Unsupported format or combination of formats (The image/matrix format is not supported by the function) in cvBoundingRect, file /build/buildd/opencv-2.4.8+dfsg1/modules/imgproc/src/shapedescr.cpp, line 97 File "<ipython-input-23-42e84e11f1a7>", line 1, in <module> cv2.boundingRect(points)

Too High CPU Footprint of OpenCV Text Overlay on FHD Video Stream

北城以北 提交于 2021-01-29 02:33:35
问题 I want to display a FHD live-stream (25 fps) and overlay some (changing) text. For this I essentially use the code below. Basically it is Load frame ( cv::putText skipped here) Display frame if it's a multiple of delay but the code is super super slow compared to e.g. mpv and consumes way to much cpu-time ( cv::useOptimized() == true ). So far delay is my inconvenient fiddle-parameter to somehow make it feasible. delay == 1 results in 180 % CPU usage (full frame-rate) delay == 5 results in 80

OpenCV symbols are undefined using gcc 5.1

我与影子孤独终老i 提交于 2021-01-29 02:33:27
问题 I have a very basic program to test that OpenCV works. #include <opencv2/opencv.hpp> int main() { cv::namedWindow("Window", CV_WINDOW_AUTOSIZE); cv::VideoCapture video_capture; video_capture.open(0); while (true) { cv::Mat image; video_capture.read(image); cv::imshow("Window", image); if (cv::waitKey(1) == 27) { break; } } return 0; } And a CMakeLists.txt file that finds OpenCV like so: find_package(OpenCV REQUIRED) ... target_link_libraries(Project ${OpenCV_LIBS}) This works on Mac OSX 10.10

Extract tiles from tiled TIFF and store in numpy array

无人久伴 提交于 2021-01-29 02:09:16
问题 My overall goal is to crop several regions from an input mirax (.mrxs) slide image to JPEG output files. Here is what one of these images looks like: Note that the darker grey area is part of the image, and the regions I ultimately wish to extract in JPEG format are the 3 black square regions. Now, for the specifics: I'm able to extract the color channels from the mirax image into 3 separate TIFF files using vips on the command line: vips extract_band INPUT.mrxs OUTPUT.tiff[tile,compression