average-faces-opencv | 👨🏻 Calculate an average face | Computer Vision library
kandi X-RAY | average-faces-opencv Summary
kandi X-RAY | average-faces-opencv Summary
Calculate an average face from multiple images in Python with OpenCV and dlib
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- R Calculate triangle indices
- Checks if a rectangle contains the given point
- Warp two triangles
- Apply Affine transform to src image
- Compute the similarity of two points
- Reads a text file
- Download an image
- Unidecode characters
- Reads images from text files
- Convert a point to a bounding box
average-faces-opencv Key Features
average-faces-opencv Examples and Code Snippets
Community Discussions
Trending Discussions on average-faces-opencv
QUESTION
I'm new to Python, therefore having troubles with debugging a script. I'm trying to create an 'average face' using an opencv
script to recreate with my own images. Here's the Github repo I'm using, but same goes for this one and this one.
The land mark detection part works but the average.py
script throws the error I don't understand how to solve.
The first two errors I solved by replacing the xrange()
function with range()
. Than the estimateRigidTransform()
seemed depricated and there for I swapped it with estimateAffinePartial2D()
so far so good.
Now the console throws me the following error:
TypeError: Expected cv::UMat for argument 'M'
This is the scripts' code snippet:
...ANSWER
Answered 2019-Feb-28 at 12:36Instead of using tform = cv2.estimateAffinePartial2D(np.array([inPts]), np.array([outPts]))
and returning tform
, return tform[0]
.
Refer to the documentation for more details.
You will notice that estimateAffinePartial2D
returns retVal
and inliers
. That's why when you are returning tform
, you are getting a TypeError
.
I have also created a PR to fix the code on our LearnOpenCV GitHub repository.
Vishwesh
Edit: You can check the PR here.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install average-faces-opencv
Run the script proving a path to where the images should be downloaded. If the folder does not exist, it will be created for your convenience:. To download the images needed for averaging, the script stitches together an image URL using the base URL and the ID of each politician from the CSV file data/politicians.csv.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page