spmallick / learnopencv Goto Github PK
View Code? Open in Web Editor NEWLearn OpenCV : C++ and Python Examples
Home Page: https://www.learnopencv.com/
Learn OpenCV : C++ and Python Examples
Home Page: https://www.learnopencv.com/
this error, happens
im1Gray = cv2.cvtColor(im1, cv2.COLOR_BGR2GRAY)
error: C:\ci\opencv_1512688052760\work\modules\imgproc\src\color.cpp:11048: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor
any soluation ?
I got a problem in the tracker example it could not find any of the trackers that implemented like (cv2.TrackerBoosting_create()) is it for the opencv version ?? i have installed 3.4.0.12 version
hei, thanks for your share,,,did you implement the paper 《Feature-based image metamorphosis》 in this project?
Environnement :
-MAC OSX
-PyCharm Community Edition 2017.2
-Python 3.6
Code raising the error in keras-mlp-mnist.ipynb :
from keras.datasets import mnist
Error raised :
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
Complete log :
Using TensorFlow backend.
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
return f(*args, **kwds)
2017-11-06 18:20:25.647592: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
Downloading data from https://s3.amazonaws.com/img-datasets/mnist.npz
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 814, in init
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/utils/data_utils.py", line 220, in get_file
urlretrieve(origin, fpath, dl_progress)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 248, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/damien/Documents/Dev/Python/keras-mlp-mnist/Code.py", line 27, in
(train_images, train_labels), (test_images, test_labels) = mnist.load_data()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/datasets/mnist.py", line 17, in load_data
file_hash='8a61469f7ea1b51cbae51d4f78837e45')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/keras/utils/data_utils.py", line 222, in get_file
raise Exception(error_msg.format(origin, e.errno, e.reason))
Exception: URL fetch failure on https://s3.amazonaws.com/img-datasets/mnist.npz: None -- [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)Process finished with exit code 1
I want to detect only one class(person) in my image. like, I want to count the number of persons in my image. how should i proceed.
Wrt to the blob detector. Is there a possibility to draw the bounding circles as filled instead of the current state?
how did you convert the jpg files to a txt file, and why do you do so?
As you see, the source tracking runs at the situation that initiated the bounding box manually.Sometimes it's not useful.So ,can you track the object combined with detecting using SIFT algorithm so that the bounding box can be initiated automatically.Or maybe you can guide me to realize the code?I hope to hear you as soon as possible.Thank you.
In the headpose.py file, what means 3D model points ? How to calc it?
model_points = np.array([
(0.0, 0.0, 0.0), # Nose tip
(0.0, -330.0, -65.0), # Chin
(-225.0, 170.0, -135.0), # Left eye left corner
(225.0, 170.0, -135.0), # Right eye right corne
(-150.0, -150.0, -125.0), # Left Mouth corner
(150.0, -150.0, -125.0) # Right mouth corner
])
I am trying Object deection with yolo.
can you you write a script so that i can iterate through a folder with images at a time
please look at https://github.com/sturkmen72/opencv_samples/blob/master/select-region-on-mouse-click.cpp. can i put some codes from http://opencvexamples.blogspot.com/ in my repository
the error With file C:\build\master_winpack-build-win64-vc14\opencv\modules\dnn\src\dnn.cpp, line1430
there is no problem with python file when i run it,but the c++ file shows the title error when i run it in vs2015 and opencv 3.4.Could you help me to figure it out?
Very Thank you!
Hi sir am new to opencv i want the code for people counter (counting the people per hour,day,month)and stored in somewhere like database.
What's the advantage of Selective Search to CNN?
Hi,
I'm interested on Pedestrian Counter project with openCV. One of the sample source code that i've found is shared by @anandsinghkunwar on git hub https://github.com/anandsinghkunwar/pedestrian-counter
But it quite confusing on returning of function line1(x,y)
and line2(x,y)
. I want to change the default lines to be transverse over the frame to be like this:
cv2.line(frame, (0,100), (500,100), (255, 0, 0), 2)
cv2.line(frame, (0,200), (500,200), (255, 0, 0), 2)
Anybody can help me to tuning the function line1(x,y)
and line2(x,y)
"Commandline usage to colorize"
The colorize should be remove
One can also use open pose estimation for gait analysis. Gait energy image is also a good technique.
line 114 should be
imwrite(str, color);
and not
imwrite(str, color*255);
Thanks.
I see you have used txt files for image facial coordianates. How did you generate those? I am not able to iterate over the predictor function of the dlib? Can you please share the code snippet?
When I use the code you supply in image alignment, I uploaded two .png file, sometimes it can run correctly, but sometimes it won't and shows the title error. Could you help me to figure it out?
Thank you!
Reading model file pcaParams.yml
Traceback (most recent call last):
File "/home/vaibhav/PycharmProjects/reconstructFace.py", line 51, in
sz = (int(sz[0, 0]), int(sz[1, 0]), int(sz[2, 0]))
TypeError: 'NoneType' object has no attribute 'getitem'
this blog(for Chinese engineers) shows how to track by detecting with yolo https://www.cnblogs.com/xiaozhi_5638/p/9376784.html
Hello,
At this lines :
Mat alpha = Mat::zeros(foreGroundImage.size(), CV_8UC3);
merge(alphaChannels, alpha);
The code crashed on merge. The alpha Mat is not created.
Could you help ?
thx
I want to detect only one class person . I want to count the number of person detected.
It would be a great help.
Can someone help it out?
It is really cool work.
I want to know how to complete it in Windows. Is that feasible?
thanks.
Tracker.cpp gives fps values only for the tracker->update, not for video.read() + tracker->update.
Better start with timer = (double)getTickCount();
just before the while(video.read) loop, and again at the end of that loop. Remove the timer from the first line in the loop.
This gives reasonable fps.
xample.cpp: In function ‘int main(int, char**)’:
example.cpp:48:22: error: ‘>>’ should be ‘> >’ within a nested template argument list
vector<vector<Point>> hull(contours.size());
the source code should have a space between the >> or it assumes bit shift..
i.e. vector< vector<Point> > hull(contours.size());
Hi, i'm developing an android application about Average Face.
I have a cpp file based on faceAverage.cpp
(https://github.com/spmallick/learnopencv/blob/master/FaceAverage/faceAverage.cpp)
but when i compile the code, i get this error:
Error:(154) undefined reference to 'cv::Subdiv2D::getTriangleList(std::__ndk1::vector<cv::Vec<float, 6>, std::__ndk1::allocator<cv::Vec<float, 6> > >&) const'
The error occur inside the calculateDelaunayTriangles function, precisely at this statement: subdiv.getTriangleList(triangleList)
The calculateDelaunayTriangles function is exactly the same as in faceAverage.cpp
How can i fix the error?
Hi, are these working modals?
Homography/homography.py is not python code
Hello! Thanks for this amazing repo, so much to learn!!
I am writing a program based on the facemorph code. It works really nicely except one detail that I can't solve yet, but I feel it must be something really simple. The warped triangles seem to overlap by 1 pixel, and their pixel colour then wraps around 255 (as I assume) and I get these lines in between the pieces (view attached image).
Any idea what would be a simple solution to that? Greatly appreciate you help!
Thanks
can someone let me know?
SystemExit Traceback (most recent call last)
in ()
53 if not success:
54 print('Failed to read video')
---> 55 sys.exit(1)
56
57 ## Select boxes
SystemExit: 1
Thanks for that nice example.
I want to use your code with automatically found landmarks (using dlib's landmark detector). So how can I get the correct assignment of the rectangles generated with delauny triangulation? Because it seems that when I just take the given order it is not correct. Means the result does not look like a face (but like rectangles on a face). Hope you can understand what I mean. Here's some pseudo code of what I'm doing:
Please help, thanks in advance.
Best regards
Patricia
solved
https://github.com/spmallick/learnopencv/tree/master/ColorSpaces there is wonderful tutorial here.
can you extend the interactive color detect into that we feed a image and get the top 5 or all color
and corresponding max and min value in each color space
Hello
I would like to extract hand keypoints in the images. So, In the multi-person-openpose.py file, how can I define the value for mapIdx of hand?
Please help me.
object_detection_yolo.cpp:40: undefined reference to cv::CommandLineParser::CommandLineParser(int, char const* const*, cv::String const&)'
I think there's some Cmake options missed out when building opencv from source.
My compiler commands:
g++ -std=c++0x -ggdb `pkg-config --cflags --libs /usr/local/lib/pkgconfig/opencv.pc` object_detection_yolo.cpp -o object.out
Here's my opencv.pc details:
# Package Information for pkg-config
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir_old=${prefix}/include/opencv
includedir_new=${prefix}/include
Name: OpenCV
Description: Open Source Computer Vision Library
Version: 3.4.2
Libs: -L${exec_prefix}/lib -lopencv_videostab -lopencv_stitching -lopencv_superres -lopencv_fuzzy -lopencv_hfs -lopencv_dnn_objdetect -lopencv_rgbd -lopencv_dpm -lopencv_optflow -lopencv_ximgproc -lopencv_ccalib -lopencv_structured_light -lopencv_xphoto -lopencv_saliency -lopencv_tracking -lopencv_datasets -lopencv_text -lopencv_dnn -lopencv_plot -lopencv_line_descriptor -lopencv_stereo -lopencv_img_hash -lopencv_xobjdetect -lopencv_surface_matching -lopencv_xfeatures2d -lopencv_shape -lopencv_ml -lopencv_phase_unwrapping -lopencv_bioinspired -lopencv_reg -lopencv_aruco -lopencv_face -lopencv_photo -lopencv_objdetect -lopencv_bgsegm -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_flann -lopencv_freetype -lopencv_imgproc -lopencv_core
Libs.private: -ldl -lm -lpthread -lrt
Cflags: -I${includedir_old} -I${includedir_new}
when I run object_detection_yolo.py, I got this error
user@user:~/Desktop/YOLOOpenCV$ python3 object_detection_yolo.py
OpenCV(3.4.1) Error: Parsing error (Unknown layer type: shortcut) in ReadDarknetFromCfgFile, file /io/opencv/modules/dnn/src/darknet/darknet_io.cpp, line 503
Traceback (most recent call last):
File "object_detection_yolo.py", line 33, in
net = cv.dnn.readNetFromDarknet(modelConfiguration, modelWeights)
cv2.error: OpenCV(3.4.1) /io/opencv/modules/dnn/src/darknet/darknet_io.cpp:503: error: (-212) Unknown layer type: shortcut in function ReadDarknetFromCfgFile
How can I solve this?
In which version of OpenCV are we suppose to run the examples ?
how to Real-time calculation of image size?
Such as the actual size of a car in the video
Take a photo to calculate the height of a person's height or a chair in the photo
Where is "#include <opencv2/face.hpp>"? Thank you
./getModels.sh: line 1: wget: command not found
./getModels.sh: line 2: wget: command not found
./getModels.sh: line 3: wget: command not found
Hi there, I'm new in the field and have problem with getting result of executing Eigenface code, here is all i got when i run Eigenface.py
Reading images from F:\learnopencv-master\EigenFace\images...
I'm using winpython-3.4.2.2.amd64
Any idea will be helpful...! Thank you
I am trying to build the object detection example on a raspberry pi 3 running raspbian. My commandline is as follows.
g++ -ggdb pkg-config --cflags --libs /usr/local/lib/pkgconfig/opencv.pc
obd.cpp -o obd.out
I am getting the following output.
^
obd.cpp:85:31: note: candidates are:
In file included from obd.cpp:5:0:
/usr/include/c++/4.8/fstream:467:7: note: std::basic_ifstream<_CharT, _Traits>::
basic_ifstream(const char*, std::ios_base::openmode) [with _CharT = char; _Trait
s = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
^
/usr/include/c++/4.8/fstream:467:7: note: no known conversion for argument 1 f
rom ‘std::string {aka std::basic_string}’ to ‘const char*’
/usr/include/c++/4.8/fstream:453:7: note: std::basic_ifstream<_CharT, _Traits>::
basic_ifstream() [with _CharT = char; _Traits = std::char_traits]
basic_ifstream() : __istream_type(), _M_filebuf()
^
/usr/include/c++/4.8/fstream:453:7: note: candidate expects 0 arguments, 1 pro
vided
/usr/include/c++/4.8/fstream:427:11: note: std::basic_ifstream::basic_ifst
ream(const std::basic_ifstream&)
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/4.8/fstream:427:11: note: no known conversion for argument 1
from ‘std::string {aka std::basic_string}’ to ‘const std::basic_ifstream&’
What do I need to do to fix this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.