3 ms·
I was thinking a bit lower level than that but yeah, I guess you get my point. I spent a day with a bug that I found in OpenCV (a computer vision/machine learn
by mbenjaminsmith 14y ago
I was thinking a bit lower level than that but yeah, I guess you get my point.
I spent a day with a bug that I found in OpenCV (a computer vision/machine learning library) that spooks me to this day. How it works internally is that for images to be processed you create a header (with usual image header info) which contains a pointer to the actual image data. There are two ways to do it: one you create the header and then create the image data separately and the other you create the image all in one go. I ended up in a situation where the image (it was going through a couple of different filtering algorithms) would get processed and be displayed regardless of whether or not I had set the pointer to the image data. That image data was already in memory since it was getting read from disk in a separate step, but there was really no way for the library to know its location in memory. I spent a day trying to sort out what was going on -- and threw my own schedule -- because I had to assume something was seriously wrong and would lead to other unintended consequences. I never did figure out what it was but after a lot of testing I decided it wouldn't cause any other problems (it never did, the library I was writing is still the core of a product I'm selling today).
If you don't know it OpenCV is about as mature as a software project can get. It was most likely the best tool for the job I had to tackle. But even with the library's stability and widespread use there was just plain voodoo that set a project I was working on back. Other 3rd party tools can be much worse. I don't do any web stuff but I have had to integrate Facebook Connect into products. Interfacing with Facebook can be a nightmare. Their API changes fairly regularly and the documentation can be a mess. Even using a 4th party, regularly updated, helper library I've seen bugs that took ages to sort out.
And that's just talking about integrating 3rd party, hopefully mature, components. I don't care how good you are, writing new code means a lot of testing and debugging. I've never seen new code that didn't introduce some voodoo of its own into a project.
- ansgri 14y agoI wouldn't call OpenCV 'about as mature as a software project can get,' as it's actively developed library with lots of contributors in yet experimental domain (more about mid-level pattern recognition than low-level image filtering). And the documentation was not up-to-date last I checked (~2 months ago). Bugs in really mature software (i.e. libtiff, libxml, sqlite) are very rare.
- mbenjaminsmith 14y agoThat's probably more accurate. I was conflating a long history with maturity/stability. I would guess most ~13 year old libraries are broadly more stable and bug-free than something a few years old but I guess anything that is being actively adapted to new problems will have inherent instability. I seriously doubt the code for reading images into an OpenCV-native format is being actively developed though. Anything being done in pattern recognition would likely not effect the library's basic IO stuff. What I was actually using it for (their RDP implementation, image thresholding) were likely pretty stable as well.