Warp Perspective with OpenCV | Document Scanner

Поділитися
Вставка
  • Опубліковано 25 сер 2024

КОМЕНТАРІ • 11

  • @giovannicode9393
    @giovannicode9393  2 роки тому +1

    Hello! If you want to learn how to build a simple Document Scanner, check this video: ua-cam.com/video/W3DzSm8WI1g/v-deo.html

  • @icecats19
    @icecats19 15 днів тому

    Great content! You have gained a subscriber!

  • @egordigitax
    @egordigitax 7 місяців тому

    thank you! thats first code i found which actually work

  • @BroughtMirrorYT
    @BroughtMirrorYT 5 місяців тому

    Thanks, god content!

  • @suryapratapsinghnaruka6961
    @suryapratapsinghnaruka6961 Рік тому

    subscribed sir

  • @prabaj84
    @prabaj84 Рік тому

    Hi, thanks for sharing this. However i tried with some real world images of id card where corners are distorted, i am not getting rectangle contour. And biggest contour is coming out to be empty for same reason, any ideas how to fix that? Tia

    • @giovannicode9393
      @giovannicode9393  Рік тому +1

      Hi, unfortunatelly in real world we have different situations and building generic model is very difficult. What we can do is to control the environment, if you taking the photos by yourself try to have the good and consistent lightning, no shadows. Also you can try experimenting with different background colors, contrasting colors may help for better contour detection.

  • @amritanjanthakur6510
    @amritanjanthakur6510 2 роки тому

    I tried something like this , m getting black border.. why is it happening?

  • @wishIKnewHowToLove
    @wishIKnewHowToLove Рік тому

    Dislike: you should use your own voice. You are not Wojack!

  • @aziahkhamis4443
    @aziahkhamis4443 Рік тому

    i got an error when using getPerspectiveTransform.
    i cant used no.float32, so i change into np.uint.
    however whent i used getPerspectiveTransform the error popup :
    here my code
    width,height= 250, 350
    pts1 = np.uint([[111,219],[287,188],[154,482],[352,440]])
    pts2 = np.uint([[0,0],[width,0],[0,height],[width,height]])
    #print(pts1,pts2)
    Matrix = cv2.getPerspectiveTransform(pts1,pts2) #cannot used this
    imgOutput = cv2.warpPerspective(img,Matrix,(width,height))
    and i got error saying
    cv2.error: OpenCV(4.8.0) :-1: error: (-5:Bad argument) in function 'getPerspectiveTransform'
    > Overload resolution failed:
    > - src data type = 8 is not supported
    > - Expected Ptr for argument 'src'
    can anyone help me?