Open cv and the jetson nano pi cam  

Page 1 / 2
  RSS

Duce robot
(@duce-robot)
Reputable Member
Joined: 9 months ago
Posts: 422
2020-02-19 2:37 am  

Can't get it to work with McWhorter sketch got everything to stop throwing up errors except line 11 matched it up but it won't work says incorrect syntax .also followed steps for installing open CV and still ended  up with py 4.1.1 instead of 3.3.1 thanks for any suggestions.??


Quote
Robo Pi
(@robo-pi)
Robotics Engineer Moderator
Joined: 10 months ago
Posts: 1602
2020-02-19 11:43 am  

Could you post your code along with the error you are getting?

Paul's coding examples are usually pretty short.  Without seeing the code and the exact error you're getting it's next to impossible to try to guess what might be going on.   One thing that comes to mind right off the bat is that OpenCV is sequence dependent in terms of code.  In other words, you need to be sure to define things before you use them in the code.  If you have anything defined on the next line after you have already referenced it, that will produce a syntax error because the compiler isn't smart enough to look ahead.   If  you haven't already defined something, then it just dies and gives up looking for it. ? 

Although that's typically not reported as a syntax error, but then again, I suppose it could be.

For being AI programming software, OpenCV is not very intelligent itself. ? 

It's up to you to have everything in order.

I ran into the "out-of-order" error quite often.  For example, if you want to call a method, you better have it defined ABOVE where you actually call it in the code.  Otherwise it doesn't know enough to look for the method further down in the code.   If just gives up and says it can't find it.   Even though you can see that it's right there on the very next line.   The compiler refuses to look that far ahead.  Lazy compiler if you ask me. ? 

DroneBot Workshop Robotics Engineer
James


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 10 months ago
Posts: 517
2020-02-19 2:37 pm  

@duce-robot

Which McWhorter lesson are you on?  Just getting OpenCV installed?  I'm caught up to him and awaiting the next Saturday after watching the latest.  There was no homework on last Saturday's lesson. ? 

SteveG


ReplyQuote
Duce robot
(@duce-robot)
Reputable Member
Joined: 9 months ago
Posts: 422
2020-02-19 7:27 pm  

@robo-pi

Yes I'm very disappointed in python the string on line 6 is just stupid long why doesn't it stack it bad design I have to go on the robot to display the code here which I will do tonight.I'm on my tablet . yes open CV should also be better and another thing the nano product I think has been updated itself so now 3.3.1 is no longer available for open CV .I saw a guy running open CV from a pi 3 b.I'm starting to lean over to that took like 10 min to get the camera on the pi working .I don't know be back in a while


ReplyQuote
Duce robot
(@duce-robot)
Reputable Member
Joined: 9 months ago
Posts: 422
2020-02-19 7:28 pm  

@codecage

I'm on lesson 11 or should I say stuck on lesson 11 lol??


ReplyQuote
byron
(@byron)
Estimable Member
Joined: 10 months ago
Posts: 201
2020-02-19 10:28 pm  
Posted by: @duce-robot

Yes I'm very disappointed in python the string on line 6 is just stupid long

It does not have to be a stupid long line of text, just break it up with the line continuation character \ ? 


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 10 months ago
Posts: 517
2020-02-20 12:15 am  

@duce-robot

What type of help do you need?  A copy of what line 6 has on it?  Or are you having trouble with the openCV install?

SteveG


ReplyQuote
Duce robot
(@duce-robot)
Reputable Member
Joined: 9 months ago
Posts: 422
2020-02-20 12:31 am  

@codecage

This is the little devil such trouble from a little thing.

1582159093130 2132269466

I hope everyone can see this


ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer Moderator
Joined: 10 months ago
Posts: 1602
2020-02-20 2:25 am  
Posted by: @duce-robot

I hope everyone can see this

There's a syntax error on line 10.

You have two starting parentheses when you should only have one.

DroneBot Workshop Robotics Engineer
James


ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer Moderator
Joined: 10 months ago
Posts: 1602
2020-02-20 3:09 am  
Posted by: @byron

It does not have to be a stupid long line of text, just break it up with the line continuation character \ ? 

I'll have to give that a shot next Saturday.  That's the only time I fire up OpenCV.  ? I wasn't aware of this trick, that will be nice.   I don't like those long lines either.  I wonder if Paul is aware of this?  I would think he would break up his long lines for his videos if he was aware that he could do it.

Thanks for the tip. ? 

DroneBot Workshop Robotics Engineer
James


ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer Moderator
Joined: 10 months ago
Posts: 1602
2020-02-20 3:31 am  
Posted by: @codecage

I'm caught up to him and awaiting the next Saturday after watching the latest.  There was no homework on last Saturday's lesson. ? 

I too am always looking forward to the next lesson.  Since he has them already recorded and laid out as "premiers" I've been looking ahead to see where we're going.   It appears that we'll be learning how to track objects, (most likely based on color recognition as that's the easiest way to do it), and then he has us building a servo mechanism to physically track objects with  our camera.

While I'm very happy to learn all of this, including being introduced to OpenCV, and how to properly load the correct version of Python onto the Jetson Nano, I wouldn't call anything he's doing "A I".    But I don't blame Paul for this since in this day and age anything that AI uses is also called AI.   It's just the way things have come to be.

None the less, I'm still very grateful to Paul for having created this series.  Like I say, even if it isn't really AI, it's still a great course on how to recognize and track objects using a video camera. ? 

There's also no telling where he will ultimate go with this course?  I have no clue where it will end, or if it will ever end?   In the meantime I'm glad to be learning what he's currently teaching.

DroneBot Workshop Robotics Engineer
James


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 10 months ago
Posts: 517
2020-02-20 10:49 am  

@duce-robot

A little tough to see, but it looks just like my line which compiles just fine.

Here is what I start with every time instead of going back to his web page every time.  What happens if you execute this code?  You might need to change the value of "flip" to a 1.

SteveG


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 10 months ago
Posts: 517
2020-02-20 1:03 pm  

@robo-pi & @duce-robot

Good eye James!  I looked and looked and didn't see that! 

SteveG


ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 10 months ago
Posts: 517
2020-02-20 1:28 pm  
Posted by: @robo-pi

It appears that we'll be learning how to track objects, (most likely based on color recognition as that's the easiest way to do it), and then he has us building a servo mechanism to physically track objects with  our camera.

Probably the same servo mechanism he had us building in the 9-axis IMU lessons.

SteveG


ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer Moderator
Joined: 10 months ago
Posts: 1602
2020-02-20 1:37 pm  
Posted by: @codecage

Probably the same servo mechanism he had us building in the 9-axis IMU lessons.

That's what I figure too.  It's good that I'm taking both courses. ? 

DroneBot Workshop Robotics Engineer
James


ReplyQuote
Page 1 / 2

Please Login or Register