OpenCV

How can I correctly link OpenCV libraries to Eclipse on Windows?

梦想与她 提交于 2021-02-07 14:10:14
问题 For the last couple of hours I have been trying to get a basic OpenCV program to work in my Eclipse Mars IDE. The program consists of the following main.cpp: #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; using namespace std; int main( int argc, char** argv ) { if( argc != 2) { cout <<" Usage: display_image ImageToLoadAndDisplay" << endl; return -1; } Mat image; image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file if(!

OpenCV: Error when using function cvGoodFeaturesToTrack

眉间皱痕 提交于 2021-02-07 13:59:30
问题 When I call the function cvGoodFeaturesToTrack to find Harris corners I get this error: OpenCV Error: Assertion failed (src.type() == CV_8UC1 || src.type() == CV_32FC1) in cornerEigenValsVecs, file /build/buildd/opencv-2.1.0/src/cv/cvcorner.cpp,line 254 terminate called after throwing an instance of 'cv::Exception' what(): /build/buildd/opencv-2.1.0/src/cv/cvcorner.cpp:254: error: (-215) src.type() == CV_8UC1 || src.type() == CV_32FC1 in function cornerEigenValsVecs Aborted It compiles

Fastest way to detect the non/least-changing pixels of successive images

笑着哭i 提交于 2021-02-07 13:47:10
问题 I want to find the pixels of a video stream that are static. This way I can detect logos and other non-moving items on my video stream. My idea behind the script is as follows: collect a number of equally-sized and graysized frames in a list called previous if a certain amount of frames is collected, call the function np.std This function loops over all the x- and y-coordinates of a new image. Calculate the standard deviation of the grayvalues for all the coordinates based on the grayvalues

Fastest way to detect the non/least-changing pixels of successive images

风格不统一 提交于 2021-02-07 13:45:03
问题 I want to find the pixels of a video stream that are static. This way I can detect logos and other non-moving items on my video stream. My idea behind the script is as follows: collect a number of equally-sized and graysized frames in a list called previous if a certain amount of frames is collected, call the function np.std This function loops over all the x- and y-coordinates of a new image. Calculate the standard deviation of the grayvalues for all the coordinates based on the grayvalues

Find median of list of images

不问归期 提交于 2021-02-07 13:27:28
问题 If I have a list of images represented by 3D ndarray such as [[x,y,color],...] , what operations can I use to output an image with values that are median of all values? I am using a for loop and find it too slow. 回答1: You said your images in color, formatted as a list of 3d ndarrays . Let's say there are n images: imgs = [img_1, ..., img_n] Where imgs is a list and each img_i is a an ndarray with shape (nrows, ncols, 3) . Convert the list to a 4d ndarray, then take the median over the

Find median of list of images

99封情书 提交于 2021-02-07 13:24:07
问题 If I have a list of images represented by 3D ndarray such as [[x,y,color],...] , what operations can I use to output an image with values that are median of all values? I am using a for loop and find it too slow. 回答1: You said your images in color, formatted as a list of 3d ndarrays . Let's say there are n images: imgs = [img_1, ..., img_n] Where imgs is a list and each img_i is a an ndarray with shape (nrows, ncols, 3) . Convert the list to a 4d ndarray, then take the median over the

Capturing and manipulating a webcam feed and exposing it as a “virtual webcam” - in Python, on Windows

孤街浪徒 提交于 2021-02-07 13:00:22
问题 The final goal would be to capture the regular webcam feed, manipulate it in some way (blur face, replace background, ...) and then output the result in some way so that the manipulated feed can be chosen as input for whatever application expects a webcam (Discord, Teams, ...). I am working on a Windows machine and would prefer to do this in Python. This combination has me lost, at the moment. capturing and manipulating is easy with https://pypi.org/project/opencv-python/ the exposing the

What's the best way of understanding opencv's warpperspective and warpaffine?

帅比萌擦擦* 提交于 2021-02-07 12:22:06
问题 I'm trying to transform a static image to give the illusion of it being taken from different angles. It seems like warpPerspective and warpAffine are the functions I should understand to make this work. However, even after read the OpenCV docs, I'm having difficulty understanding them. What tutorials/docs should I read that explain them very well? 回答1: warpPerspective does a projective transformation or homography: http://en.wikipedia.org/wiki/Homography warpAffine does an affine

What's the best way of understanding opencv's warpperspective and warpaffine?

社会主义新天地 提交于 2021-02-07 12:21:28
问题 I'm trying to transform a static image to give the illusion of it being taken from different angles. It seems like warpPerspective and warpAffine are the functions I should understand to make this work. However, even after read the OpenCV docs, I'm having difficulty understanding them. What tutorials/docs should I read that explain them very well? 回答1: warpPerspective does a projective transformation or homography: http://en.wikipedia.org/wiki/Homography warpAffine does an affine

Can an uploaded image be loaded directly by cv2?

可紊 提交于 2021-02-07 11:51:51
问题 I have an uploaded file in memory. I want to manipulate the file with cv2. Currently, I write the file to disk then read it with cv2. How can I skip writing the file and load it directly with cv2? file = request.files['file'] # if file and allowed_file(file.filename): # save file filename = secure_filename(file.filename) file_path = os.path.join(dressrank.config['SHOW_IMG_FOLDER'], filename); file.save(file_path) img_path = file_path # COLOR FATURE EXTRACTION img = read_img(img_path) img =img