473,395 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to use the online code source? ---- A general question

Dear all,
I am not a professional programmer. In stead, I am using C++ mostly
for my research work. My knowledge of C++ is only good enough for my
computation. I really don't use the advanced feature of C++ very much
(e.g. virtual functions, templates, etc. ).
Recently, I have to work on some image processing problems. My first
thought is to use C++ instead of Matlab, However, I don't want to
reinvent the wheel, to rewrite all the functions. Then I start to
search the existing libraries, and also the existing C++ code so that
I can shorten the developing time.
Now my problem is that there are a lot of online sources, for example,
I need k-means analysis, I found several already existing packages for
that. But how can I integrate those source codes into my program?
Usually they all have their own classes which may very likely not
compatible with your own classes.

So my question to all of you is:
1. how do you use the online source codes? Do you think it is helpful?
For me, at this moment, reading the codes seem to take more time (but
I still think I did not master the skill to use those codes).
2. how do you choose the libraries? I found OpenCV an Magick++ are all
good libraries for image processing, and now I am hesitating which one
I should use?

Thanks in advance.
Dave

Apr 18 '07 #1
2 1379
On 18 Apr, 03:37, "Dave.Sun.M...@gmail.com" <Dave.Sun.M...@gmail.com>
wrote:
Dear all,
I am not a professional programmer. In stead, I am using C++ mostly
for my research work. My knowledge of C++ is only good enough for my
computation. I really don't use the advanced feature of C++ very much
(e.g. virtual functions, templates, etc. ).
Recently, I have to work on some image processing problems. My first
thought is to use C++ instead of Matlab, However, I don't want to
reinvent the wheel, to rewrite all the functions. Then I start to
search the existing libraries, and also the existing C++ code so that
I can shorten the developing time.
Now my problem is that there are a lot of online sources, for example,
I need k-means analysis, I found several already existing packages for
that. But how can I integrate those source codes into my program?
Usually they all have their own classes which may very likely not
compatible with your own classes.

So my question to all of you is:
1. how do you use the online source codes? Do you think it is helpful?
For me, at this moment, reading the codes seem to take more time (but
I still think I did not master the skill to use those codes).
There are different ways and it depends on the code you want to use.
Some of them will be compiled into libraries which you make calls to
from your code, others might have to be included and compiled into
your own project. I would suspect that most of the more extensive ones
will be libraries.

Which way to go depends on how much of the functionality you need, if
it's just one function you should probably try to understand how it
works and try to recreate it in your code but if you need more you
should probably use it as it is. As you say they might not be
compatible with your code which means that you'll either have to
convert your data into a format that will work with the library, or
you might try to convert your code to operate on their data-types.
2. how do you choose the libraries? I found OpenCV an Magick++ are all
good libraries for image processing, and now I am hesitating which one
I should use?
Sorry, can't help you there, perhaps you should ask in a group such as
sci.image.processing.

--
Erik Wikström

Apr 18 '07 #2
Da***********@gmail.com wrote:
Recently, I have to work on some image processing problems. My first
thought is to use C++ instead of Matlab,
Oh well, why did you make this choice? If you are not a professional
programmer, using matlab for image processing task can save you from a
lot of work, because a lot of things are already implemented and the
image manipulation is easier.

Anyway, I'm using C++ for my research as well, but I come from industry,
so I know quite well C++. Nevertheless, I often prefer matlab as well if
the task is a common one and the speed of the algorithm is not a problem.

The speed factor actually is a good point to prefer c++, but keep in
mind that a well written matlab code can outperform a badly written c++
code!
However, I don't want to
reinvent the wheel, to rewrite all the functions. Then I start to
search the existing libraries, and also the existing C++ code so that
I can shorten the developing time.
Good idea.
Now my problem is that there are a lot of online sources, for example,
I need k-means analysis, I found several already existing packages for
that. But how can I integrate those source codes into my program?
Usually they all have their own classes which may very likely not
compatible with your own classes.
You can make slight modification to their code to adapt it to your
classes, or build a proxy between your classes and their classes
converting the input and the output.
So my question to all of you is:
1. how do you use the online source codes? Do you think it is helpful?
For me, at this moment, reading the codes seem to take more time (but
I still think I did not master the skill to use those codes).
Of course it is useful. But of course, to use other people's code you
have to know c++, otherwise it can be impossible to do that. Keep in
mind that a big advantage to use already written code is that usually is
bug free, especially if it is used by a lot of people, and this can save
you from a lot of problems.
2. how do you choose the libraries? I found OpenCV an Magick++ are all
good libraries for image processing, and now I am hesitating which one
I should use?
I'm happily using Magick++ (especially to have the input-output routine
for a lot of different image formats for free), however under windows
it can be a little bit a trouble to install it to let it work properly.
Regards,

Zeppe
Apr 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.