RSS
 

Archive for June, 2009

OpenCV: Threshold one channel in RGB image

26 Jun

To threshold one channel in RGB image or any other type it looks like this: This peace of code is inspired from a post in the OpenCV mailing.

In case you want to threshold the blue channel for example, so follow this steps

You would first split the BGR image in the three channels:

cvSplit(BGRimg, Bimg, Gimg, Rimg)

Then, use thresholding to theshold the blue plane to a binary image according to whatever criteria you need (i.e. a 1 is a pixel to keep a 0 is a pixel to discard):

cvThreshold(Bimg, Bimgthresh, ….criteria…)

the use this thresholded image as a “mask” to filter the channels by simple multiplication:

cvMul(Bimg, Bimgthresh, Bimg) cvMul(Gimg, Bimgthresh, Gimg) cvMul(Rimg, Bimgthresh, Rimg)

then recombine the planes into the image

cvMerge(Outimg, Bimg, Gimg, Rimg)

 
No Comments

Posted in OpenCV

 

Best PDF writer

26 Jun

As you may know that M$ Windows is unstable and expensive. Moreover, It is empty of useful things.
Even the easy task of creating or converting a PDF file is a real burden of mind.
So thinking free I found this tool:
CutePDF Writer creates professional quality PDF files from almost any printable document. FREE for personal, commercial, gov or edu use! No watermarks! No popup Web ads!
It supports 64-bit Windows. You can download it from here.

For Macintosh,
All the stuff you need to create PDF’s is built it
Go to print and select ‘save as…’ from the PDF drop down at the bottom left.
You can rearrange orders, compile and all that by using automator actions.
It just ready!!

 
 

IPhone: Apple iPhone 3.0 Launch

26 Jun

The new firmware of IPhone has been launch. Here is the presentation about it.
[youtube]http://www.youtube.com/watch?v=qpygoPE9FFs[/youtube]

 
No Comments

Posted in IPhone

 

Replace a string in the field of SQL table

25 Jun

Using the UPDATE instruction we can change the value of a field in SQL table easily but when it come to change a word in the field with out changing it all here is the problem. The following instruction solves the problem:
the table is “emp” containing a field “destination” and we need to change the word Sales with Marketing for all the occurrences.
[code="sql"]
UPDATE emp set designation=replace(designation, 'Sales', 'Marketing') where 1
[/code]

 
 

Thousands of video lectures from the world's top scholars

24 Jun

I found recently a good website where you can watch full lectures in a very famous Universities like Stanford.
You can access it from here