Go to Post We are engineers after all so I say "Bring on the technology"!:yikes: - emersont49 [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-01-2012, 19:47
pavanetti's Avatar
pavanetti pavanetti is offline
Registered User
FRC #1382
 
Join Date: Dec 2010
Location: Brazil
Posts: 12
pavanetti is an unknown quantity at this point
Smile Getting pixels of camera images in C++

I'm studing image processing and I already wrote algorithms for this task in my computer. These algorithms is in C++ too and they uses images in files. But they depends on access to the images pixels. Is there a way to do this in wpi?
I want to track rectangles in the camera image. I like something like this:

AxisCamera &cam = AxisCamera::GetInstance();
MonoImage &image = cam.GetImage()->GetLuminancePlane();
for (int i = 0; i < image.GetWidth(); ++i) {
for (int i = 0; i < image.GetWidth(); ++i) {
Color pixel = image.GetPixels(i, j);
}
}
Reply With Quote
  #2   Spotlight this post!  
Unread 12-01-2012, 20:05
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Getting pixels of camera images in C++

The images are transmitted from the camera as a JPEG and you must decode it before you can actually do what you want to do. What you posted will not work. I don't think the Image class even has a "getWidth" or "getHeight". It does however have a pointer to the Image in memory, which is encoded in JPEG. I suggest making your own Image class that takes the WPILib's Image and converts it to a 2d arrays of bytes. Since it is C++, it would be uint_8 (GCC)
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.

Last edited by davidthefat : 12-01-2012 at 20:09.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi