View unanswered posts | View active topics It is currently Wed Sep 03, 2014 12:41 am






Reply to topic  [ 3 posts ] 
NXTCam V2 blob array sort order 
Author Message
Rookie
User avatar

Joined: Sun Jun 17, 2012 11:18 am
Posts: 26
Post NXTCam V2 blob array sort order
Hi Xander,

I have a question. In you driver of NXTCam, is the returned blob array sorted? I have a glance at the source code and it seems to be sorted in DESCENDING order of blob size. Am I right?


Tue Feb 19, 2013 2:47 am
Profile
Rookie
User avatar

Joined: Sun Jun 17, 2012 11:18 am
Posts: 26
Post Re: Getting drivers working for NXTCam V2
Besides, I think there's a bug in the driver.
In line 218 of "drivers/mindsensors-nxtcam.h", a "-" seems mistyped as "*".

blobs[_i].size = abs(blobs[_i].x2 - blobs[_i].x1) * abs(blobs[_i].y2 * blobs[_i].y1); //I think here's a bug
blobs[_i].size = abs(blobs[_i].x2 - blobs[_i].x1) * abs(blobs[_i].y2 - blobs[_i].y1); //It should be like this


Tue Feb 19, 2013 4:17 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3211
Location: Rotterdam, The Netherlands
Post Re: NXTCam V2 blob array sort order
The blobs are indeed sorted, with the largest one being at index 0. Thanks for the bug report! That is indeed a mistake.

= Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Feb 19, 2013 5:40 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.