Raspberry Pi LESSON 48: Creating A Bouncing Box Overlay in OpenCV

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ธ.ค. 2024

ความคิดเห็น • 35

  • @markbooco1719
    @markbooco1719 ปีที่แล้ว

    Thanks for great lesson! Several trial and errors hours but got it accomplished. No pain no gain!

  • @pralaymajumdar1206
    @pralaymajumdar1206 ปีที่แล้ว

    Very interesting lesson & always awesome.. Being an Engineers it's a great achievement to get u in TH-cam. Thank u sir from India..

  • @wilsonlittle4833
    @wilsonlittle4833 ปีที่แล้ว

    I've been a BAD student!!! I'm now on my third series with TTB, and I absolutely love your teaching style, and I learn a heck of a lot. I do each homework in advance, and attempt to enhance it beyond what is requested. However, I simply fail to routinely post, or even mark the video as a LIKE. Even though they are very deserving of the acknowledgement. Thanks for all your effort.

  • @richhoneyford9789
    @richhoneyford9789 ปีที่แล้ว

    Folded like a cheap Chinese chair. I solved the methodology but over-thought the tuple. I thought that tuples cannot be changed so did all kinds of crazy things to change tuple. Got a headache and gave it up.
    I love watching your river background. God is a magnificent artist.

  • @martinlewis645
    @martinlewis645 ปีที่แล้ว

    Thank you again for a great lesson. I was close, but needed a bit of help.

  • @daveCotterill
    @daveCotterill ปีที่แล้ว

    Brilliant Lesson, absolutely make sense working it out on paper first. Unfortunately I failed to come up up with a working solution, but I will get better!. Thanks for your hard work.

  • @qzorn4440
    @qzorn4440 ปีที่แล้ว

    very nice. In a programming class you always make your flow chart and write the code on paper before touching the computer. This way the plan is understood first. 😎 Thank you so much.
    The engineers on the factory floor have to have a working upgrade program before they shut the assembly line down on the weekend so it will work Monday morning.

  • @tkklein
    @tkklein ปีที่แล้ว

    I miss these tutorials!

  • @arguedas02
    @arguedas02 ปีที่แล้ว

    Great series of lessons it is amazing all the things we can learn on this classes Thank You Paul, for your hard work... Blessing ....

  • @tntragan
    @tntragan ปีที่แล้ว +2

    Another great lesson. I am working on your artificial intelligence series and it is really meshing nicely with this series. Thanks to that and the lessons on visual python, I was able to complete this lesson.

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว +1

      Yes, this will touch on a lot of similar topics, but then will have some new directions as well.

  • @jameslewellen150
    @jameslewellen150 ปีที่แล้ว

    Thanks for this wonderful explanation. I was pretty much sitting in a walmar lawn chair, with some help I was able to get it done.

  • @cbrombaugh
    @cbrombaugh ปีที่แล้ว

    Thanks for another great Pi lesson Paul!

  • @kau_norw
    @kau_norw ปีที่แล้ว

    Very thoroughly explained, thank you.

  • @ctlancearrowlarson8237
    @ctlancearrowlarson8237 ปีที่แล้ว

    Just thought I'd say a small thing about taking class notes. What works best for me are 5"X8"(12.7cmX20.32cm) ruled index cards. Sometimes Daiso Japan Stores carry these clear plastic boxes (6"X9"-1"deep), where I store the cards. I know notes can be taken on a computer, but I like paper.

  • @Slowpaws1389
    @Slowpaws1389 ปีที่แล้ว

    Will be following your excellent work, I have a few Raspberry Pi's in the house as NAS and honeypots, I started back in the day with a sinclair zx80 and courses in Fortran

  • @RobWood-cf4ct
    @RobWood-cf4ct ปีที่แล้ว

    I am legend. Unfortunately, I don't have recording equipment so cannot post my solution as suggested. Doesn't make sense to me to post code here either. Anyway, I was able to get the box bouncing as well as the circle from the previous lesson. My solution was slightly different because I used a multiplier in the main code and then multiply it by -1 in the if statements to change direction. The circle was slightly easier because the edge is r away from the center in all directions. In any event, I enjoy all your content. Keep up the good fight. Rob

  • @LorenBurdette
    @LorenBurdette ปีที่แล้ว

    Great Explanation! I got the HW and worked it out on paper first but my drawing wasn't near as nice as yours. You are the man, sir!

  • @DrDave327
    @DrDave327 ปีที่แล้ว

    👍Great content, Paul!

  • @DavidConner-yz2ud
    @DavidConner-yz2ud ปีที่แล้ว

    Really enjoying the class! I was able to solve the homework - very similar to your solution. I tried moving this to the new Bookworm OS but was not successful. Apparently openCV installs differently in Bookworm so I was defeated at square one!

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว +1

      In going through these lessons it is good to stay on the same version of the OS I am on. Most things should be the same, but sometimes difficulty installing libraries if you are on different versions.

  • @ramonestana7338
    @ramonestana7338 ปีที่แล้ว

    Dear Paul, thank you very much for your great work! Now, whats about speech recognition with the jetson nano or xavier? Could this possible? Thanks again very much❤

  • @JuliaDaser
    @JuliaDaser ปีที่แล้ว

    I am Legend! (Didn't post the homework on TH-cam but I managed to complete it!)

  • @alldaypancakes7058
    @alldaypancakes7058 ปีที่แล้ว

    if you go to raspberry leson 5 homework you can see a ant on the breadbord i am suprised that you didnt see it i saw it and i wasnt even looking at the breadbord its in first 37 minuts of the video much love you are great

  • @TheTimeProphet
    @TheTimeProphet ปีที่แล้ว

    It was interesting, but I hate python with a passsion and much prefer C++ modular programming. I watched because you have a great presentation style.

  • @thomaslawless7279
    @thomaslawless7279 หลายเดือนก่อน

    I set my moving box relative to the centre point, instead of defining the parameters explicitly but still got the same result: import cv2
    from picamera2 import Picamera2
    import time
    piCam=Picamera2()
    piCam.preview_configuration.main.size=(1280,720)
    piCam.preview_configuration.main.format="RGB888"
    piCam.preview_configuration.controls.FrameRate=30
    piCam.preview_configuration.align()
    piCam.configure("preview")
    piCam.start()
    time.time
    fps=0
    pos=(30,60)
    font=cv2.FONT_HERSHEY_SIMPLEX
    height=1.5
    colour=(0,0,255)
    weight=3
    upperLeft=(650,500)
    lowerRight=(750,575)
    #rColour=(255,255,255)
    thickness=3
    cent=(640,360)
    rColour=(0,125,255)
    cThick=7
    r=35
    cColour=(0,255,255)
    CbWidth=1280-1
    CbHeight=720-1
    CbPix=(CbWidth, CbHeight)
    MbWidth=int((1280/4)-1) #319
    MbHeight=int((720/4)-1) #179
    MbPix=[MbWidth, MbHeight]
    offset_x = int(MbWidth/2)
    offset_y = int(MbHeight/2)
    dx = 3 # Change in x (horizontal speed)
    dy = 2 # Change in y (vertical speed)
    while True:
    tStart=time.time()
    frame=piCam.capture_array()
    MbUpperLeft = (MbPix[0] - offset_x, MbPix[1] - offset_y)
    MbLowerRight = (MbPix[0] + offset_x, MbPix[1] + offset_y)
    cv2.putText(frame,str(int(fps))+" FPS",pos,font,height,colour,weight)
    cv2.rectangle(frame,MbUpperLeft,MbLowerRight,rColour,thickness)
    if MbUpperLeft[0] < 0 or MbLowerRight[0] > CbWidth: # Check horizontal boundaries
    dx *= -1 # Reverse direction
    if MbUpperLeft[1] < 0 or MbLowerRight[1] > CbHeight: # Check vertical boundaries
    dy *= -1 # Reverse direction
    MbPix[0] += dx
    MbPix[1] += dy
    cv2.imshow("piCam",frame)
    if cv2.waitKey(1)==ord("q"):
    break
    tEnd=time.time()
    loopTime=tEnd-tStart
    fps=0.9*fps + 0.1*(1/loopTime)
    print(int(fps))
    cv2.destroyAllWindows()

  • @freddyveza
    @freddyveza 5 หลายเดือนก่อน

    I am legend!

  • @timefactortheoryofgravitya7578
    @timefactortheoryofgravitya7578 ปีที่แล้ว

    My video has an added feature. In the lower left corner it displays: (X=xxxx Y=xxx) ~ Rxxx Gxxx Bxxx ,where ever I point the mouse on the frame. Why?

  • @keithlohmeyer
    @keithlohmeyer ปีที่แล้ว

    👍YT juice.

    • @DrDave327
      @DrDave327 ปีที่แล้ว

      Great idea Keith! I will do the same.