Hi guys, we have downloaded the lastest version of opencv 3.4, and set up the vs2017 environment for opencv. We also downlloaded the faster_rcnn_vgg16.prototxt, and VGG16_faster_rcnn_final.caffemodel from https://github.com/rbgirshick/py-faster-rcnn.
However,when we run the faster_rcnn.cpp, the detection out is null. And vs2017 have a interrupt , the program stop at here:
#ifdef _DEBUG
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL _Debug_message(const wchar_t *message, const wchar_t *file, unsigned int line)
{ // report error and die if(::_CrtDbgReportW(_CRT_ASSERT, file, line, NULL, L"%ls", message)==1)
{
::_CrtDbgBreak();
}
}
and the output messages show:
*Second Chance Assertion Failed: File C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.11.25503\include\vector, Line 1810*
here show some figures. Thanks!
!
fig.1 interrupt
'
fig.2 console outputs

fig.3 project files
↧
could not run demo "faster_rcnn.cpp"
↧
Elliptical Fourier Descriptors
Is there a working on Elliptical Fourier Descriptors with C++?
I found a work with Python( https://github.com/alessandroferrari/elliptic-fourier-descriptors ), but I could not find it with C++.
↧
↧
Extract elements of GUI using MSER
Hello,
I need to extract elements from a GUI (example: butons, radio buttons, text boxes, dropdowns, etc) and i used the method MSER. But sometimes the result is not perfect. Is there any other method in OpenCV?
Thank you,
Rita Maia
↧
opencv video compression issue
hi i am using opencv to capture the video from webcam...
for my project purpose i need to compress my video resolution so i use the following code
in my project...
import cv2
cap = cv2.VideoCapture(0)
cap.set(CV_CAP_PROP_FRAME_WIDTH, 640);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 360);
the above code shows the following error....can you please tel me what is the problem is
NameError: name 'CV_CAP_PROP_FRAME_WIDTH' is not defined
↧
Compile OpenCV for CentOS
Hello,
How to compile the last version of OpenCV for Cent OS ?
Thank you,
Christophe
↧
↧
Three questions about HOG detector
have following code and I have some questions about it: 1. What is detection window size for HOG detector and how does it change within program run? 2. What classificators are being used in OpenCV HOG detector? 3. Confusion matrix for HOG in OpenCV?
# detect people in the image and start counting time
start = datetime.datetime.now()
(rects, weights) = hog.detectMultiScale(image, winStride=winStride,
padding=padding, scale=scale, useMeanshiftGrouping=meanShift)
#end time counting
print("[INFO] detection took: {}s".format(
(datetime.datetime.now() - start).total_seconds()))
# draw the original bounding boxes
for (x, y, w, h) in rects:
cv2.rectangle(image, (x, y), (x + w, y + h), (0, 255, 0), 2)
# show the output image
cv2.imshow("Detections", image)
cv2.waitKey(0)
print ("dws: ", dws)
↧
make is failed: opencv_test_stab
I have ubuntu 16.04 with python 3.5
I am trying to install opencv without CUDA and the make is failed with the following error message:
[C:\fakepath\opencv.png](/upfiles/15178466361645434.png)
collect2: error: ld returned 1 exit status
modules/world/CMakeFiles/opencv_test_videostab.dir/build.make:127: recipe for target 'bin/opencv_test_videostab' failed
Is there any idea how to resolve the problem?
↧
Hello all, currently i'm trying to run binary file of a paper "Scene Conditional Background Update for Moving Object Detection in a Moving Camera" but i'm getting error 0xc000007b.
i have taken binary file from link "https://github.com/CansenJIANG/SCBU" i'm attaching error file too. can anyone check this binary file please. My configuration is windows 7 visual studio 2010. Thanks
↧
OpenCV code/library to remove scanning artifacts
I see a lot of questions on internet in order to remove the scanning artifacts/lines/background noise etc.. from images with help of OpenCV library. For example to prepare image for OCR process.
Looks like this is a pretty common task but I unable to find any opensource implementation based on OpenCV for this purpose. Is there anything already available for this purpose with no needs to implement such kind of task on the low level with OpenCV help ?
↧
↧
3D reconstruction of Rubik's cube. Did you try it?
The task seems elementary at first glance, but try and it turns out to be tricky. Meanwhile this is just a geometric puzzle and a perfect application for various OpenCV methods. Enjoy. I don't ask about solving it or color detection. It is regarded just as a box.
↧
Comparing an image with a reference image (master image) and finding out the deviation in dimension
I have some reference images for each category like circle, square, rectangle etc. which is more like a master image for that category.
When any user clicks a picture in his mobile and sends it for validation under a particular category, I need to pick the master image of that category and compare the image taken in mobile with master image. After comparison, I need to figure out the deviation in dimension of the image if any as compared to the master image.
The question may sound too broad but that's how my use case is unfortunately. All I am looking for is a proper pointer to start off and steps to be followed to come up with an optimal solution
↧
Can I change the fps of a video dynamically?
I am using VideoWriter in python with opencv3.4. I wanted to change the fps of a video dynamically. Presently I am using `out = cv2.VideoWriter('output.avi',fourcc,60.0, (848,480))` where `60.0` is the fps. Is it possible that at some part of my code , I can change it to 30fps and then back to 60fps or something else at some other part of the code?
↧
Why doesn't opencv.js include CvKNearest?
It appears that the Javascript version doesn't include some classes, such as CvKNearest. Why is this? Where can I find a list of all the included/excluded classes and functions?
↧
↧
Draw square that covers area of pixel cluster in binary image (Python)
I have this image

I'd like to crop to the orange content so that I end up with this: (Note that the forum's own code is zooming in the image to fit the frame but I don't in fact need it zoomed in. Just cropped to the orange content.

The approach I'm taking is finding the follow by range and I end up with a binary mask of just the orange section. So after doing `cv2.inRange` I send up with this mask

From there I trying to find the contours and then the convex hull to reduce the number of vertices to just 4 (the orange content has at least 8), but this is where I'm running into problems. Essentially I'd like to end up with a binary mask of a square that covers as far as the orange content reaches. It should look like this:

So then with that mask I can do a bitwise and on the original image so that I end up with this:

Then finally I'll crop out the black regions as much as I can (I think I have an idea of how I can do that), so that I can end up with the desired image:

I'm stuck at creating the square that cover the entire area of the orange. So far I'm able to threshold and create the bitwise mask with the shape of the orange region. I can find the contours of it, but them simplifying the vertices and drawing a square is the hard part.
↧
detect control from Winform image with OpenCV
Hello Sir,
[C:\fakepath\controlsample.png](/upfiles/15179034671518166.png)
Please look the attached image i want to detect WinForm's control from image. In this screen
two Button,Check Box and radio button available.
Now i want to detect as a those control as button,checkbox and radio button via
SIFT or SURF algorithm.Does it possible detect those object from image?
Can anyone suggest me how to train a model and which algorithm is better for the purpose?
Please look below image as output sample.
[C:\fakepath\output.png](/upfiles/15179033688388639.png)
Thanks,
↧
Detect blur, sharpness of the single image
I am trying to create validation of the image into my mobile application for different platforms(iOS, Android, etc.)
Googled a lot I found some solutions and snippets but unfortunately they are not opaque for me.
The idea is take a picture and validate it. For example attached image is not valid.
Is it possible to make this kind of validation using OpenCV? I want to have functions like isBlurry(image), isSharped(image)
[sample blurry image ( 0,99 MB ! )](/upfiles/14560511153919833.jpg)
↧
What does cv2.bitwise_and do? What are its parameters?
I'm just starting out with OpenCV and following this tutorial:
http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_core/py_image_arithmetics/py_image_arithmetics.html
Here's the code:
# Load two images
img1 = cv2.imread('messi5.jpg')
img2 = cv2.imread('opencv_logo.png')
rows,cols,channels = img2.shape
roi = img1[0:rows, 0:cols ]
# Now create a mask of logo and create its inverse mask also
img2gray = cv2.cvtColor(img2,cv2.COLOR_BGR2GRAY)
ret, mask = cv2.threshold(img2gray, 10, 255, cv2.THRESH_BINARY)
mask_inv = cv2.bitwise_not(mask)
# Now black-out the area of logo in ROI
img1_bg = cv2.bitwise_and(roi,roi,mask = mask_inv)
# Take only region of logo from logo image.
img2_fg = cv2.bitwise_and(img2,img2,mask = mask)
# Put logo in ROI and modify the main image
dst = cv2.add(img1_bg,img2_fg)
img1[0:rows, 0:cols ] = dst
cv2.imshow('res',img1)
cv2.waitKey(0)
cv2.destroyAllWindows()
I understand everything here except the 2 lines of code containing "bitwise_and" .
↧
↧
Python error: imwrite() takes at most 3 arguments (4 given)
I'm facing with problem in code:
import cv2
from pathlib import Path
from lib.cli import DirectoryProcessor
from plugins.PluginLoader import PluginLoader`
class ExtractTrainingData(DirectoryProcessor):
def create_parser(self, subparser, command, description):
self.parser = subparser.add_parser(
command,
help="Extract the faces from a pictures.",
description=description,
epilog="Questions and feedback: \
https://github.com/deepfakes/faceswap-playground"
)
def process(self):
extractor_name = "Align" # TODO Pass as argument
extractor = PluginLoader.get_extractor(extractor_name)()
try:
for filename in self.read_directory():
image = cv2.imread(filename)
for idx, face in self.get_faces(image):
resized_image = extractor.extract(image, face, 256)
output_file = self.output_dir / Path(filename).stem
cv2.imwrite(str(output_file) + str(idx) + Path(filename).suffix, resized_image, [int(cv2.IMWRITE_JPEG_QUALITY), 100], interpolation=cv2.INTER_NEAREST)
except Exception as e:
print('Failed to extract from image: {}. Reason: {}'.format(filename, e))
I want to add parameter interpolation=cv2.INTER_NEAREST to function cv2.imwrite, but in output i'm getting Failed to extract from image: /home/Jane/Desktop/50.jpg. Reason: imwrite() takes at most 3 arguments (4 given) Any tips how to fix it? I've tried add interpolation via int
cv2.imwrite(str(output_file) + str(idx) + Path(filename).suffix, resized_image, [int(cv2.IMWRITE_JPEG_QUALITY), 100], [int(interpolation), CV_INTER_LINEAR])
but this doesn't helped me. :( According to the documentation, i can only pass three parameters. But i've see ppl doing it via 2 steps. Any ways how to fix it? Thanks guys! :)
↧
I am getting error in findContours() function
[Final.py](https://github.com/AnupamYedida/Sign_Language_Recognition/blob/master/final.py)
final.py is showing error -
Line 179: xyz,contours,hierarchy = cv2.findContours(thresh1.copy(),cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE) ValueError: need more than 2 values to unpack
I am stuck here for hours please help
Currently using python 2.7 and Opencv 2.4
↧
Python 2.7 OpenCV 3.4 - 3.1 video capture crashes
##### System information (version)
- OpenCV => 3.1 or 3.4 (details in text)
- Operating System / Platform => Windows 7 32 Bit
- Anaconda2 Python 2.7 32 bit
##### Detailed description
I'm trying to capture video from webcam but program crashes even with the simple test script: the first frame is a complete blank image. After returning this frame, program crashes. I tried to do the typical fix:
-I'm waiting even 5 seconds before reading on the opened device.
-isOpened() returns True, like ret.
-I've added to the path user environment variable the two folder Anaconda2 and Anaconda2/Scripts.
I'm running anaconda2 2.7 32 bit. I tried to install opencv 3.4 pyd copying from **official** zip or installing opencv3 from conda repo with ` conda install -c menpo opencv3`. VideoCapture on avi,mpeg1,mpeg2,mpeg4 videos works fine. Imread works with jpg, png but not with gif. I tried even to install ffmpeg in conda using` conda -c install menpo ffmpeg`, but nothing seems to work.
Any help?
##### Steps to reproduce
Program Output:
('numpy v.', '1.13.3')
('openCV v.', '3.4.0')
Device Opened
new iter
(True, (480, 640, 3))
new iter
##### Code
import numpy as np
print('numpy v.', np.__version__)
import cv2
print('openCV v.', cv2.__version__)
#print(cv2.getBuildInformation())
#open dev
cap = cv2.VideoCapture(0)
if cap.isOpened():
print("Device Opened\n")
else:
print("Failed to open Device\n")
exit(1)
#loop
#cv2.namedWindow('webcam')
while(True):
print('new iter')
ret, frame = cap.read()
print(ret,frame.shape)
cv2.imshow('webcam',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
#release
cap.release()
cv2.destroyAllWindows()
↧