davidrmiller / biosim4

Biological evolution simulator
Other
3.21k stars 460 forks source link

Getting an error when running program #91

Open mollthecoder opened 1 year ago

mollthecoder commented 1 year ago

When I run the program with saveVideo = true, I get an error:

terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.5.1) ../modules/videoio/src/cap_ffmpeg.cpp:172: error: (-215:Assertion failed) image.depth() == CV_8U in function 'write'

It runs fine when I turn saveVideo off. I'm running on a raspberry pi 4, with a 32-bit OS.

$ uname -a
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

The error is exactly the same with both Release and Debug builds. I've already checked, and all of the dependencies are installed.

davidrmiller commented 1 year ago

Hi @mollthecoder, sorry you're getting that error. I remember in #74 that you were trying to get a docker image running on the raspi which sounded like it might be the path of least resistance, but I never heard if you were successful. How did that go? @mathematicalmichael reported getting it running in #10, but since I don't even own a raspi, we will have to appeal to the community for ideas.

mollthecoder commented 1 year ago

Hi @mollthecoder, sorry you're getting that error. I remember in #74 that you were trying to get a docker image running on the raspi which sounded like it might be the path of least resistance, but I never heard if you were successful. How did that go? @mathematicalmichael reported getting it running in #10, but since I don't even own a raspi, we will have to appeal to the community for ideas.

I gave up on it. But for some reason when I tried it today it compiled seamlessly with make without issues once I put CImg.h in the src directory.

mollthecoder commented 1 year ago

There's only an issue when I turn the saveVideo option on. It runs fine otherwise.

mollthecoder commented 1 year ago

@davidrmiller Any idea what may be causing the error?

davidrmiller commented 1 year ago

OpenCV is throwing an exception. There must be something different about OpenCV in the Raspberry Pi compared to Ubuntu 21.04, 22.04, or Debian 10. Or possibly the difference is in the cimg.h interface. I wonder if an OpenCV support group could suggest ways to debug this?

mollthecoder commented 1 year ago

Update: It happens in 64-bit Raspberry Pi OS too.

mollthecoder commented 1 year ago

I installed Ubuntu on the pi and still had the problem.

surfingdoggo commented 1 year ago

@mollthecoder I just cloned the repo onto my rpi4 with 64bit rasbian lite, ran it vanilla with Video enabled, and it works!

Happy to help if you'd like.

mollthecoder commented 1 year ago

@mollthecoder I just cloned the repo onto my rpi4 with 64bit rasbian lite, ran it vanilla with Video enabled, and it works!

Happy to help if you'd like.

Hey! Sorry, I seemed to have missed that message when you sent it. If it's not too late I'd appreciate some help. Just to confirm, it continues to work after several minutes, and you successfully get the proper videos?

Are you able to reproduce it on a fresh install of Raspberry Pi OS 64-bit Desktop? Sorry if that's overly specific, but I want to make sure our environments are as aligned as possible. If I'm able to get it working on a fresh install, then that should be able to easily be expanded to many more setups.

obiscr commented 4 months ago

I build it Ubuntu 24.04(Docker Container)

# uname -a
Linux d40237726acb 6.6.31-linuxkit #1 SMP Thu May 23 08:36:57 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

I got the same error.

terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.6.0) ./modules/videoio/src/cap_ffmpeg.cpp:192: error: (-215:Assertion failed) image.depth() == CV_8U in function 'write'

I don't know how to fix this