Ask Your Question

ninamdk's profile - activity

2017-03-31 07:50:11 -0600 commented question Bounding rectangle for a cloud of points

Hello, Sorry for the rushed question. I just realized that I made a mistake in changing the type of the variable with numpy, so it was a float64 and that caused opencv to reject the matrix. This question can be deleted. Thanks again

2017-03-31 07:30:02 -0600 asked a question Bounding rectangle for a cloud of points

Hi,

I'm trying to draw a bounding rectangle around a cloud of points.

I tried to use cv2.boundingRect() on the set of points but I get this error:

cv2.error: opencv-3.2.0/modules/imgproc/src/shapedescr.cpp:466: error: (-215) npoints >= 0 && (depth == CV_32F || depth == CV_32S) in function pointSetBoundingRect

Any idea on how I could do this ?

Thank you

2017-03-31 07:08:43 -0600 received badge  Enthusiast
2017-03-26 09:46:08 -0600 commented question [solved] Does saliency module from opencv_contrib work in python ?

Thank you for testing this, I guess I will try to find another model less sensitive in that case than the opencv implementation

2017-03-24 10:50:43 -0600 commented question [solved] Does saliency module from opencv_contrib work in python ?

I just edited my first post :) the output is always a white image

2017-03-24 10:43:50 -0600 received badge  Editor (source)
2017-03-24 10:34:07 -0600 asked a question [solved] Does saliency module from opencv_contrib work in python ?

Hi,

I am trying the Motion saliency algorithm in the Saliency module from Opencv_contrib (in python) but it doesn't seem to work. I didn't find any example on how to use the python wrapping of these functions. Did anyone try it before and can help me figure out what's wrong ?

Thank you EDIT!:

The code I tried:

import cv2
import skvideo.io

video = skvideo.io.VideoCapture(video_file)
_, img = video.read()
imgsize = img.shape
saliency = cv2.saliency.MotionSaliencyBinWangApr2014_create()
saliency.setImagesize(imgsize[0], imgsize[1])
saliency.init()

while True:
    success, img = video.read()
    if success:
        gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        out = saliency.computeSaliency(gray)
        cv2.imshow("sal", out[1]*255)
     else:
          break

The output is a white image

output of help(cv2.saliency)

Help on module cv2.saliency in cv2:

NAME
    cv2.saliency

FILE
    (built-in)

FUNCTIONS
    MotionSaliencyBinWangApr2014_create(...)
        MotionSaliencyBinWangApr2014_create()
-> retval

    ObjectnessBING_create(...)
        ObjectnessBING_create() -> retval

    StaticSaliencyFineGrained_create(...)
        StaticSaliencyFineGrained_create() -> retval

    StaticSaliencySpectralResidual_create(...)
        StaticSaliencySpectralResidual_create()
-> retval