Comments (16)
The work around for OpenCV 3.2 is to edit renderer.py def wrapImg()
if prj.size != 0:
pixels = cv2.remap(img, np.squeeze( np.asarray( prj[0,:] ) ).astype('float32').reshape(t_height, t_width),\
np.squeeze( np.asarray( prj[1,:] ) ).astype('float32').reshape(t_height, t_width), cv2.INTER_CUBIC)
pixels = pixels.reshape(pixels.shape[0]*pixels.shape[1], pixels.shape[2])
# pixels = pixels[:,0,:]
new_img[idx,:] = pixels
from face_specific_augm.
Hi every one, I'm a student from China.
Here's the blog of the whole process from install opencv to run the imput1 example
May be can help you a little
http://www.cnblogs.com/QingHuan/p/6753440.html
from face_specific_augm.
It works fine with version 3.1.0.5
from face_specific_augm.
I just spent the entire night trying to fix this. Just wanted to share the solution that ended up working for me:
- The line throwing the error is an assertion. Comment the line throwing the error:
<opencv folder>/modules/imgproc/src/imgwarp.cpp:4956: error: (-215) dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX in function remap
- Recompile OpenCV (cmake, make)
- Install it again (make install)
from face_specific_augm.
Hi every one, I'm a student from China.
Here's the blog of the whole process from install opencv to run the imput1 example
May be can help you a little
Hi,
I'm testing the project and I have some problems.
- I have changed ThreeD_Model.py:63 --> contours, hierarchy = to **, contours, hierarchy =**_
Because with opencv 3.2.0 findCountours return 3 params.- Now I can run the demo.py script, but when I have generated 10 images in output (always 10 images), I get this error:
OpenCV Error: Assertion failed (dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX) in remap, file <PATH_TO_OPENCV>/opencv-3.2.0/modules/imgproc/src/imgwarp.cpp, line 4956 Traceback (most recent call last): File "demo.py", line 111, in <module> demo() File "demo.py", line 86, in demo model3D.ref_U, eyemask, model3D.facemask, opts) File "<PATH_TO_FACESPECIFICAUGM>/faceSpecificAugm/renderer.py", line 109, in render frontal_raw = warpImg(img, ref_U.shape[0], ref_U.shape[1], prj_jnt, ind_jnt) File "<PATH_TO_FACESPECIFICAUGM>/faceSpecificAugm/renderer.py", line 25, in warpImg np.squeeze( np.asarray( prj[1,:] ) ).astype('float32'), cv2.INTER_CUBIC) cv2.error: <PATH_TO_OPENCV>/opencv-3.2.0/modules/imgproc/src/imgwarp.cpp:4956: error: (-215) dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX in function remap
Any ideas? Thanks!!!
so,how you solve this question finally?
from face_specific_augm.
I get the same error, even for a single image. I'm using opencv-python==3.2.0.6
from face_specific_augm.
Hi @zhixuanli ,
thank you very much for your help and I am sure your guide can help the community so much.
Thanks,
-iacopo
from face_specific_augm.
Hi All,
thank you for your feedback. I also got into trouble while running this with OpenCV3.
I think there is a quick fix that I used that briefly was the following:
- check which version of Opencv is running inside the code with something similar to
python -c 'import cv2; print cv2.__version__'
- use the detected version to redirect the code to use OpenCV2 function in one case (the current code) or the new modified code to run smoothly with OpenCV3
I think I did this patch locally and it worked but I did not have the time to push it on the server.
So in theory there is not need to modify and recompile OpenCV3.
I will try to push the patch in case I have time.
I hope this helps,
iacopo
from face_specific_augm.
Hi,
I'm having the same issue here using OpenCV 3.2.0.
Is there any other solution except the one dshahrokhian posted? I couldn't find the imgwarp.cpp file.
Many thanks,
-Benny.
from face_specific_augm.
I've also got this issue, I've tried hacking around the problem with no success, it looks like the current solution is really just to recompile. I'm sorry that this comment does not offer any solutions but just wanted to highlight that this is not an isolated incident.
Kind regards,
Waj
from face_specific_augm.
@benibraz it's at <opencv folder>/modules/imgproc/src/imgwarp.cpp
.
@WajWaraich Did you try my solution?
Dani
from face_specific_augm.
Dani, thanks for your reply, I was trying to avoid having to recompile the library but I might have to now. I was planning on compiling OpenCV 3.3 and seeing whether that still contained the bug.
UPDATE 1: Upgrading to 3.3 did not help, the error simply went from line 4956 to 4944 as there have been some changes in imgwarp.cpp
, I'll try commenting out the CV_Assert()
line and recompile the library - see if that helps.
UPDATE 2: Got it all working by following Dani's ( @dshahrokhian ) instructions, just commented out the line that was causing the issue and recompiled and everything seems to be working smoothly.
from face_specific_augm.
@andychuajl where is this file?
from face_specific_augm.
I think the file you need is in renderer.py
from face_specific_augm.
I just spent the entire night trying to fix this. Just wanted to share the solution that ended up working for me:
- The line throwing the error is an assertion. Comment the line throwing the error:
<opencv folder>/modules/imgproc/src/imgwarp.cpp:4956: error: (-215) dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX in function remap
- Recompile OpenCV (cmake, make)
- Install it again (make install)
how to recompile opencv?
from face_specific_augm.
It works fine with version 3.1.0.5
me too
from face_specific_augm.
Related Issues (20)
- cv2 error in remap when running demo.py HOT 1
- ValueError: too many values to unpack (expected 2) HOT 1
- Question about 3D head model HOT 1
- Error:ValueError: too many values to unpack HOT 1
- Error HOT 1
- Question about downloading the model HOT 4
- MATLAB 3D Model Renderer HOT 5
- when i run the demo, there occured an error in function warpImg, can anyone help? thx HOT 1
- errors when render
- ValueError: too many values to unpack HOT 3
- 3D models HOT 1
- Error when 'background=no' in the config.ini file HOT 2
- Do we have synthetic lighting rendering in this repo? HOT 1
- face expression HOT 2
- landmark position in facemask
- going from profile to frontal HOT 2
- question on "extreme poses and viewing conditions" and resnetON = yes HOT 1
- Dlib, opencv and imutils version HOT 2
- Opencv 4.2.0 error HOT 1
- adding more angles and directions HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from face_specific_augm.