Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The converted image rotate, trying using rotate or transpose don't fix it

Hello this first time for me using SimpleCV: I got problem, when I convert opencv image to simplecv image, it's rotated.. I try using rotate, and flip, but command findBlobs won't work if I using rotated image.. I'm trying these solution here but didn't work too.. Here my code:

bgsMOG = cv2.BackgroundSubtractorMOG2()
cap    = cv2.VideoCapture("d:\1.avi")
if cap:
    while True:
        ret, frame = cap.read()

        if ret:
            fgmask     = bgsMOG.apply(frame, None, 0.01)
            simplecvimg= Image(fgmask, cv2image=True)
            asli       = Image(frame, cv2image=True)

            blobs      = simplecvimg.findBlobs()
            if blobs is not None:
                blobs.draw()
            car_bounding_box = blobs[0].boundingBox()            
            blobs[-1].drawRect(color=(0,255,0), width=1,alpha=128) #128
            simplecvimg.drawCircle((blobs[-1].centroid()),1,color=Color.RED)
            simplecvimg.show()

What should I do to rotate the simplecv image and how to resize the window in simplecvimg.show()? Thanks for your help..