microsoft / ailab

Experience, Learn and Code the latest breakthrough innovations with Microsoft AI
https://www.ailab.microsoft.com/experiments/
MIT License
7.69k stars 1.39k forks source link

Error: (-215: Assertion failed) !_scr.empty() in function 'cv::cvtColor' #127

Open Henrilux opened 3 years ago

Henrilux commented 3 years ago

Hi

I'm having error when running processing the pictures. Error screen reads as attached file 1.png processing photos while having this error as attached file 2.png

I saved this project under below route C:\Users\edz\Desktop\ailab-master\VirtualStage\BackgroundMatting

would you be able to help solving this issue?

thanks.

1 2
enquel commented 3 years ago

@Henrilux I have solved a bunch or errors leading to this one. Have you figured it out? For me the path to OpenCV stated in error is the same as yours, and actually there is nothing there on my system, so my guess is that the paths are mixed in .py script, causing the script to point to a nonexistent address.

enquel commented 3 years ago

This may mean that the Python bindings for OpenCV are not initialized properly at all. Can someone from MS pick that up?

berak commented 3 years ago

please make sure you give a proper image path (DOUBLE CHECK!) to the --back argument of the script

enquel commented 3 years ago

@berak thank you for answer. Is there a resource somewhere on actual usage patterns or do I need to go each python script line by line to figure out how to use the script parameters? Also, is there a way to get output without compositing the new background video with --back parameter?

enquel commented 3 years ago

@berak I have checked and it works for me, I think we can close this.

Henrilux commented 3 years ago

@berak I have checked and it works for me, I think we can close this.

Hi,

I still haven't solve the issue..

below is where we tried to fix the path but didnt work. would you be able to have a quick look see if we have missed anything?

e0e26fb9bb1298ab40ab6d04c5b8a53 feec98d9886c3cf96000a527099b8f8
enquel commented 3 years ago

@Henrilux the paths seem ok. Have you modified the Python script just like @berak suggested? I had no further issues afterwards.

berak commented 3 years ago

@Henrilux -- you probably misunderstood something, it's NOT AT ALL about installing opencv.

you have to invoke the python script with a proper --back /some/valid/imagepath argument, that's all.

hutianyang commented 3 years ago

@berak I have checked and it works for me, I think we can close this.

Hi,

I still haven't solve the issue..

below is where we tried to fix the path but didnt work. would you be able to have a quick look see if we have missed anything?

e0e26fb9bbtoo1298ab40ab6d04c5b8a53 feec98d9886c3cf96000a527099b8f8

I have the same problem ,too . Have you found any solutions

neaorin commented 3 years ago

I tracked down this error to running the run.ps1 script for background matting from a regular PowerShell prompt. I instead ran it from PowerShell ISE, and everything went fine.

For some reason, one of the data preparation steps fails (it's the one calling KinectMaskGenerator.exe in prepare_data.py) and then everything breaks.

Use PowerShell ISE to run the script instead.