Go to Post And, learn to collaborate, 'cause it works. - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 02-14-2014, 11:48 PM
Irene-4574 Irene-4574 is offline
Registered User
FRC #4763
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Fullerton
Posts: 9
Irene-4574 is an unknown quantity at this point
Applying Gaussian Blur to Camera Images

Hello.

Is there any way to apply a Gaussian Blur to an RGBImage? Is there a library or a function that can do this?

Here's a sample of our image processing code for reference.

ColorImage *image;
image = camera->GetImage();
image->Write("/original.bmp");
//Here's where we'd like to add the blur
BinaryImage *thresholdImage = image->ThresholdHSV(threshold);
thresholdImage->Write("/threshold.bmp");
BinaryImage *filteredImage = thresholdImage->ParticleFilter(criteria, 1);
filteredImage->Write("Filtered.bmp");

Thank you for any help you can give us!
Reply With Quote
  #2   Spotlight this post!  
Unread 02-15-2014, 10:03 AM
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Applying Gaussian Blur to Camera Images

C:\Program Files (x86)\National Instruments\Vision\Documentation\NIVisionCVI.chm

or the Program Files version is the documentation for the C entry points of the vision processing library that is already installed on target and on potentially on the driver station.

I think you are looking for the Spatial Filters using a Gaussian kernel. There are lots to choose from.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 02-15-2014, 10:53 AM
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: Applying Gaussian Blur to Camera Images

Quote:
Originally Posted by Irene-4574 View Post
Hello.

Is there any way to apply a Gaussian Blur to an RGBImage? Is there a library or a function that can do this?

Here's a sample of our image processing code for reference.

ColorImage *image;
image = camera->GetImage();
image->Write("/original.bmp");
//Here's where we'd like to add the blur
BinaryImage *thresholdImage = image->ThresholdHSV(threshold);
thresholdImage->Write("/threshold.bmp");
BinaryImage *filteredImage = thresholdImage->ParticleFilter(criteria, 1);
filteredImage->Write("Filtered.bmp");

Thank you for any help you can give us!
There are plenty of libraries that can do a gaussian blur, but most of them are huge and require a lot of space on your device.

If you want to get down to what a blur is fundamentally, it is a NxN (typically 3x3) matrix that goes through your image and changes the pixel values according to some factor. A common blur is to simply average the pixel values within the NxN matrix. But, this is a color image, therefore it is 3 channels deep. So, you're going to have to apply a blur to the red, blue, and green channel (or h, s, and v depending on what you are doing).

Here is how opencv does a gaussian blur: http://docs.opencv.org/doc/tutorials...al_filter.html

A gaussian blur is a little different than the averaging technique. It gives more value to the pixels in the center: http://homepages.inf.ed.ac.uk/rbf/HIPR2/gsmooth.htm

I don't know your means of doing computer vision, so this is all the help I can give with the information I have. If you have any other questions, don't be afraid to ask!
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
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 09:51 AM.

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