openframeworks / openframeworks/openFrameworks

Setting ROI on ofxCvFloatImage and using draw throw error.

Open
#2,836 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

addon bug section-2D
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.