openframeworks / openframeworks/openFrameworks
Setting ROI on ofxCvFloatImage and using draw throw error.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
When using setRoi on ofxCvFloatImage and using the draw method I got this:
[ error ] ofxCvFloatImage: operator=: source width and/or height are zero:0 0
OpenCV Error: Assertion failed (src.size == dst.size && src.channels() == dst.channels()) in cvConvertScale, file /home/arturo/host/Downloads/OpenCV-2.3.1/modules/core/src/convert.cpp, line 1193
terminate called after throwing an instance of 'cv::Exception'
what(): /home/arturo/host/Downloads/OpenCV-2.3.1/modules/core/src/convert.cpp:1193: error: (-215) src.size == dst.size && src.channels() == dst.channels() in function cvConvertScale
However if I use resetRoi and then drawRoi, it works and I got the same effect as draw.
Also with drawRoi it show the correct roi area always.
I'm using of0.8 on Linux with codeblocks.
Best regards
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with ofxCvFloatImage after setRoi, then inspect the setRoi, draw, resetRoi, and drawRoi paths. Compare the ROI dimensions passed through draw with those used by drawRoi; done means drawing the ROI no longer raises the zero-size or OpenCV assertion errors and preserves the reported ROI behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, opencv
- Domain
- computer-vision
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100