C# or Java ??
-
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
Funny you should ask as I have been developing image processor routines in C# for the past 2 weeks for OCR apps. Image manipulation is fairly easy once you are able to pull images into the correct binary classes, then I have been able to apply image transitions quite easily on a bit by bit level. Its not as fast as I would like but I have not optimised the code at all, it takes about 3 seconds to apply a brighten & sharpen filter on a 247k grayscale tiff. I am limited by the choice of language here though and have no idea on how fast java would perform.
-
Assembly.
Shhhhh..... http://craptasticnation.blogspot.com/[^]
-
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
You sure got a lot of stupid answers to that question. Anyway, I depends on what language you know best and especially how complex you app is going to be. If it's pretty advanced Java has a big advantage in that there's the JAI (Java Advanced Imaging) API, and AFAIK there's not really any equivalent API for C# (.NET) though I can be mistaken. Ergo: If you know C# really well, and you app is going to be mostly home-implemented algorithms use C#, otherwise if you are going to make a big image processing app, and want to take advantage of a very nicely build API use Java and JAI.
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand -
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
pure image processing, or GUI? what platform? cross platform? the best way (in my experience) is to separate the GUI application from the image processing logic. best image processing library support is in C++, then Java. C# comes last. easiest to GUI (at least in .NET) is probably C#. if you have serious image processing - C++ (and C) give you the best programmatic control, which C# and Java don't. (they are more elegant, but much "weaker"). hope i helped. good luck.
noams66
-
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
I'd definetely say C#. Not because of tha language itself but because of the tools that are provided for it. Visual Studio will make your life so much easier than working with Eclipse or NetBeans. And I love C#, so this probably isn`t an impartial opinion. Regards,
-
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
rockNroll wrote:
I have got a new project which is based on image processing.
and what kind of image processing? some people have answered as if that explains everything. I see no explanation at all. Basic image processing (histogram, color shift, edge detect, etc.) or user defined image processing (advanced filtering, fractal edge detect, wavelet differencing), or even real-time image processing (image processing on live video, multi-frame blind convolution, image based object tracking). These are all image processing, but they conjure different levels of need as far as existing infrastructure in the language, and especially speed. Basic image processing is usually easy enough language is irrelevant, java has an image library you can use to help, C# can use existing dll based image libraries through the infamous pinvoke. The only question relevant is based on personnel, which do you know, which can be better supported by your staff?
rockNroll wrote:
C# or Java and why ?
why did you choose those languages? you could have chosen COBOL, or LOGO, or PL1. Are those the languages you know, the only ones you know, and you have to build this? Then perhaps, maybe this is the right question. Though if your requirements do include anything that will refer to speed, you may not be the right person for this project if that is all you know. I love the answer that skipped C++ and went straight to assembly if speed matters, by making absurd associations like that people try very hard to kill a language that refuses to die because it is still being used. All in all, you haven't given enough information to answer, anyone who says otherwise is basing their decision on their language preference only. what are your requirements? what does the user expect?
------------------ John Andrew Holmes "It is well to remember that the entire universe, with one trifling exception, is composed of others."
-
C++, then Java, then C#. That is just my two cents. Having developed in all three I think I have a solid foundation of the opinion as well.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway -
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
It depends to you and your client,but my suggestion is C# and also c++ is good.
-
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
-
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
between the two C# but for image processing u should consider C++
-
jsd001002 wrote:
C#,It is faster
would you mind providing empirical evidence to that extent? Having developed two 3D platforms in Java, I'm not convinced of all this slowness that people purport Java to have. Specifically, can you demonstrate what areas C# is faster in?
-
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
As noted, the best language is likely the one you are most familiar with. Some notes, Java comes with the JAI which is a library specifically designed for Image processing. There is also a very good Java Image Processing book. Unfortunately the book was released before the JAI library so does not take advantage of it. The book is, regardless, quite good. C# has image processing libraries available from third parties. As noted in this thread, if you want a GUI interface on top, Visual Studio provides a handy WYSIWYG GUI editor. I prefer hand coding these things, so Java works better for me there. C++ has many good third party image processing libraries available. As far as speed, I think you'll find Java comparable to C++ in most respects, and good benchmarking tests and tools will make this clearly evident. The one thing I would point out, though, is that Java has a very poor implementation for their trig library and it is VERY slow. This is the only thing that would give me pause to use Java for image processing.
-
Never tried Fortran. But did use PLAN on an ICL 1900 series, as well as COBOL and Assembler on an IBM 360. Those were the days when timeshare was common and input via a punched card/tape after agency punching them from 80 column hand written coding sheets.
-
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
-
jsd001002 wrote:
C#,It is faster
would you mind providing empirical evidence to that extent? Having developed two 3D platforms in Java, I'm not convinced of all this slowness that people purport Java to have. Specifically, can you demonstrate what areas C# is faster in?
He is probably just bloating the forum. I'd say that C# and Java perform very closely with some specific parts one is fast than the other, but nothing really significant. What is the fact is that both of them are outperformed by C++ and other unmanaged languages. Managed languages have many advantages, but some of them comes at the cost of performance like automatic garbage collection. I might be wrong but if I were to choose a language only for performance reasons I would have a hard time trying to decide on C# or JAVA. Maybe I would just flip coins.
-
Image processing - how intense? If very: C++ If not: C#, but then I'm biased towards good languages.
I'm largely language agnostic
After a while they all bug me :doh:
Well, for REALLY intense image processing you will want to use assembly language. One time I wrote a raytracer for calculating the signal strength of an 802.11 network. In C++ it took around 700ms to refresh the screen with one access point. (1000x800 pixel map, 2.2 GHz dual core cpu, single-threaded renderer). Making the renderer threaded dropped the render time to around 500ms - but rewriting the inner loop in assembly language (only 19 instructions) doubled the speed to 250 ms.
-
I'm sure he doesn't mean write EVERYTHING in assembly. I write almost all of my code in native C++, and for really speed-critical stuff I use asm optimizations. An RF raytracer I wrote last week experienced a perceptible speed improvement just by changing a few sqrt calls to assembly. Consider the statement
dist=sqrt(dsq);
The code generated by this is nearly 60 instructions long: (simplified for display)fld dsq
call sqrt
fstp dist;Everything below this is in msvcrt.dll
sqrt:
; save stack frame and registers - about 8 instructions
call _sqrtf
; restore stack frame and registers - about 8 instructions
ret_sqrtf:
; save stack frame and registers - about 8 instructions
call _sqrt
; restore stack frame and registers - about 8 instructions
ret_sqrt:
; save stack frame and registers - about 8 instructions
fsqrt
; restore stack frame and registers - about 8 instructions
retThe same exact result can be obtained by using three inline assembly instructions:
fld dsq
fsqrt
fstp distThis is TWENTY TIMES LESS CODE than the high-level version! This is admittedly an extreme example, but it was taken directly from code I wrote last week, in an inner loop executing about 5x10^7 times per update.
modified on Tuesday, May 20, 2008 2:35 PM
-
Hi, I have got a new project which is based on image processing. Which language will be better for this project.. C# or Java and why ? cheers rNr
I suppose you'll done some binary conversation of an image. If you look for faster code, then write it in C# or C/C++ better (Or asm if you need critical fast code). If you look for easier code - write it to the language you know better. If you want just file conversation (but not displaying the image) I suggest you PHP.
-
I'm sure he doesn't mean write EVERYTHING in assembly. I write almost all of my code in native C++, and for really speed-critical stuff I use asm optimizations. An RF raytracer I wrote last week experienced a perceptible speed improvement just by changing a few sqrt calls to assembly. Consider the statement
dist=sqrt(dsq);
The code generated by this is nearly 60 instructions long: (simplified for display)fld dsq
call sqrt
fstp dist;Everything below this is in msvcrt.dll
sqrt:
; save stack frame and registers - about 8 instructions
call _sqrtf
; restore stack frame and registers - about 8 instructions
ret_sqrtf:
; save stack frame and registers - about 8 instructions
call _sqrt
; restore stack frame and registers - about 8 instructions
ret_sqrt:
; save stack frame and registers - about 8 instructions
fsqrt
; restore stack frame and registers - about 8 instructions
retThe same exact result can be obtained by using three inline assembly instructions:
fld dsq
fsqrt
fstp distThis is TWENTY TIMES LESS CODE than the high-level version! This is admittedly an extreme example, but it was taken directly from code I wrote last week, in an inner loop executing about 5x10^7 times per update.
modified on Tuesday, May 20, 2008 2:35 PM
-
Funny you should ask as I have been developing image processor routines in C# for the past 2 weeks for OCR apps. Image manipulation is fairly easy once you are able to pull images into the correct binary classes, then I have been able to apply image transitions quite easily on a bit by bit level. Its not as fast as I would like but I have not optimised the code at all, it takes about 3 seconds to apply a brighten & sharpen filter on a 247k grayscale tiff. I am limited by the choice of language here though and have no idea on how fast java would perform.