Giter Site home page Giter Site logo

Comments (16)

andychuajl avatar andychuajl commented on August 24, 2024 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.

zhixuanli avatar zhixuanli commented on August 24, 2024 6

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.

beeva-enriqueotero avatar beeva-enriqueotero commented on August 24, 2024 5

It works fine with version 3.1.0.5

from face_specific_augm.

dshahrokhian avatar dshahrokhian commented on August 24, 2024 2

I just spent the entire night trying to fix this. Just wanted to share the solution that ended up working for me:

  1. 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
  2. Recompile OpenCV (cmake, make)
  3. Install it again (make install)

from face_specific_augm.

XinyingZheng avatar XinyingZheng commented on August 24, 2024 2

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

Hi,

I'm testing the project and I have some problems.

  1. I have changed ThreeD_Model.py:63 --> contours, hierarchy = to **, contours, hierarchy =**_
    Because with opencv 3.2.0 findCountours return 3 params.
  2. 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.

beeva-enriqueotero avatar beeva-enriqueotero commented on August 24, 2024

I get the same error, even for a single image. I'm using opencv-python==3.2.0.6

from face_specific_augm.

iacopomasi avatar iacopomasi commented on August 24, 2024

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.

iacopomasi avatar iacopomasi commented on August 24, 2024

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.

benibraz avatar benibraz commented on August 24, 2024

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.

WajWaraich avatar WajWaraich commented on August 24, 2024

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.

dshahrokhian avatar dshahrokhian commented on August 24, 2024

@benibraz it's at <opencv folder>/modules/imgproc/src/imgwarp.cpp.

@WajWaraich Did you try my solution?

Dani

from face_specific_augm.

WajWaraich avatar WajWaraich commented on August 24, 2024

@dshahrokhian

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.

abhi-infrrd avatar abhi-infrrd commented on August 24, 2024

@andychuajl where is this file?

from face_specific_augm.

iacopomasi avatar iacopomasi commented on August 24, 2024

I think the file you need is in renderer.py

from face_specific_augm.

XinyingZheng avatar XinyingZheng commented on August 24, 2024

I just spent the entire night trying to fix this. Just wanted to share the solution that ended up working for me:

  1. 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
  2. Recompile OpenCV (cmake, make)
  3. Install it again (make install)

how to recompile opencv?

from face_specific_augm.

secretdragon avatar secretdragon commented on August 24, 2024

It works fine with version 3.1.0.5

me too

from face_specific_augm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.