OpenCV

Patch priority and its effect on Criminsi's Exemplar Based Inpainting

允我心安 提交于 2021-02-07 09:37:29
问题 I am trying to implement exemplar based in-painting, as proposed by Criminsi et. al. in its original format (before moving into further optimisations). I have a few theoretical doubts which I would like to clarify. I am not sure how the patch priority and the determination of fill-order works to propagate linear structures into the user-selected target region. From what I understand, Criminsi suggests the following: Determine the fill front dΩ. Compute the patch priorities [C(p)D(p)] on

OpenCV Draw rectangle from center x,y

怎甘沉沦 提交于 2021-02-07 09:27:54
问题 I want to draw a rectangle using only a point to the center. So pretty much a rectangle around my center point. What is the easiest way of doing this?Thanks. 回答1: Considering that center=(x,y) , then: cv::rectangle( image, cvPoint(x-w/2,y-h/2), cvPoint(x+w/2,y+h/2), CV_RGB(r,g,b), 1, 8 ); CvRect stores the top-left point as reference. So: CvRect myrect=cvRect(x-w/2,y-h/2,w,h); 来源: https://stackoverflow.com/questions/17785602/opencv-draw-rectangle-from-center-x-y

OpenCV - Save video segments based on certion condition

时光总嘲笑我的痴心妄想 提交于 2021-02-07 09:26:30
问题 Aim : Detect the motion and save only the motion periods in files with names of the starting time . Now I met the issue about how to save the video to the files with video starting time. What I tested : I tested my program part by part. It seems that each part works well except the saving part. Running status : No error. But in the saving folder, there is no video. If I use a static saving path instead, the video will be saved successfully, but the video will be override by the next video. My

How to extract text region from an image after detecting

天大地大妈咪最大 提交于 2021-02-07 09:24:49
问题 I am trying to extract all text regions from an image using opencv python. I have successfully detected the text regions but could not extract it. I extracted the smaller sub-matrices of a text region but I cannot aggregrate them into a bigger matrix that we see as the text region in the image. import numpy as np import cv2 from imutils.object_detection import non_max_suppression import matplotlib.pyplot as plt %matplotlib inline from PIL import Image # pip install imutils image1 = cv2.imread

How to compile OpenCV with OpenMP

淺唱寂寞╮ 提交于 2021-02-07 09:10:28
问题 A user in this SOF post suggests building OpenCV with a WITH_OPENMP flag to enable (some) multi-core support. I have tried building OpenCV-2.4.10 with OpenMP but I am unable to then import cv2 in Python. Note: I am able to build and use OpenCV-2.4.10 in Python. The problem is building with the WITH_OPENMP flag. I am replacing lines 49-58 in opencv-2.4.10/cmake/OpenCVFindLibsPerf.cmake , as suggested in this blog post, with the following: # --- OpenMP --- if(NOT HAVE_TBB AND NOT HAVE_CSTRIPES)

How to compile OpenCV with OpenMP

匆匆过客 提交于 2021-02-07 09:08:26
问题 A user in this SOF post suggests building OpenCV with a WITH_OPENMP flag to enable (some) multi-core support. I have tried building OpenCV-2.4.10 with OpenMP but I am unable to then import cv2 in Python. Note: I am able to build and use OpenCV-2.4.10 in Python. The problem is building with the WITH_OPENMP flag. I am replacing lines 49-58 in opencv-2.4.10/cmake/OpenCVFindLibsPerf.cmake , as suggested in this blog post, with the following: # --- OpenMP --- if(NOT HAVE_TBB AND NOT HAVE_CSTRIPES)

Is there any function in OpenCV or Emgu CV desktop capture options? (addons, libs, classes)

给你一囗甜甜゛ 提交于 2021-02-07 09:07:07
问题 Is there any function in OpenCV or Emgu CV desktop capture options? (addons, libs, classes) So I know we can capture camera in a very easy way, is there any option for desktop capturing that way? 回答1: I would recommend doing a screen capture outside of Emgu (ie, in non-Emgu C++/C#). The first step is to create a bitmap from the screen image. There are plenty of websites detailing methods of how to do this. I found this one helpful. Once you have a bitmap, it's easy to create new Emgu Image<,>

Is there any function in OpenCV or Emgu CV desktop capture options? (addons, libs, classes)

荒凉一梦 提交于 2021-02-07 09:03:23
问题 Is there any function in OpenCV or Emgu CV desktop capture options? (addons, libs, classes) So I know we can capture camera in a very easy way, is there any option for desktop capturing that way? 回答1: I would recommend doing a screen capture outside of Emgu (ie, in non-Emgu C++/C#). The first step is to create a bitmap from the screen image. There are plenty of websites detailing methods of how to do this. I found this one helpful. Once you have a bitmap, it's easy to create new Emgu Image<,>

How to improve OpenCV and python VideoWriter resolution?

放肆的年华 提交于 2021-02-07 08:19:08
问题 I have a script which uses OpenCV and python and creates a video ( avi format ) from a set of png images. The resolution of these images is good. The problem is that the resolution of the resulting video is very low. How can I improve the resolution? Is the low resolution related to the images format? CODE: writer = cv2.VideoWriter( "C:\Users\.../demo3_4.avi", -1, 1, ( width, height ) ) nFrames = 24 for i in range( 1, nFrames ): img = cv2.imread( os.path.join( str( inf ), "colorraster%d.jpg"

How to improve OpenCV and python VideoWriter resolution?

回眸只為那壹抹淺笑 提交于 2021-02-07 08:14:41
问题 I have a script which uses OpenCV and python and creates a video ( avi format ) from a set of png images. The resolution of these images is good. The problem is that the resolution of the resulting video is very low. How can I improve the resolution? Is the low resolution related to the images format? CODE: writer = cv2.VideoWriter( "C:\Users\.../demo3_4.avi", -1, 1, ( width, height ) ) nFrames = 24 for i in range( 1, nFrames ): img = cv2.imread( os.path.join( str( inf ), "colorraster%d.jpg"