You'll need to install the opencv packages (including libcv-dev) in your scratchbox environment as well.