|
|
Efficient way to pass a .jpg in c# program to compiled function
Hi I am hoping that someone would have some ideas for a
more efficient way of solving the problem I currently have.
I am running a C# program that calls a Matlab compiled
function, this function needs an image as input and
currently I am taking the input .jpg within the C#,
converting into a bitmap, saving off the r,g,b components
as separate double arrays, then converting these into
mxDoubleMatrix, passing all three into the function and
then constructing back into an image within the Matlab
function.
This is obviously a very time consuming process and I would
be very grateful to anyone who could think of a better way
of just passing the .jpg directly or pointing me in better
direction.
Many thanks in advance for your help,
J Hill
|
|
0
|
|
|
|
Reply
|
jameshill1000 (3)
|
7/1/2008 10:47:03 AM |
|
In article <g4d1v7$97s$1@fred.mathworks.com>,
James Hill <jameshill1000@hotmail.co.uk> wrote:
>Hi I am hoping that someone would have some ideas for a
>more efficient way of solving the problem I currently have.
>I am running a C# program that calls a Matlab compiled
>function, this function needs an image as input and
>currently I am taking the input .jpg within the C#,
>converting into a bitmap, saving off the r,g,b components
>as separate double arrays, then converting these into
>mxDoubleMatrix, passing all three into the function and
>then constructing back into an image within the Matlab
>function.
>This is obviously a very time consuming process and I would
>be very grateful to anyone who could think of a better way
>of just passing the .jpg directly or pointing me in better
>direction.
You could potentially reprogram the matlab function so that
if it detected a character string in that location, it did
an imread() on the string as a file name to load the image itself.
Otherwise, instead of saving the r, g, b components into
separate double arrays, put them all together into a single array,
red plane then green plane then blue plane. That's all that
a truecolor "image" is to Matlab, an N x M x 3 array of double,
so there would be no need of "constructing back into an image"
within the Matlab function.
--
"The Romans believed that every man had his Genius, and every
woman her Juno." -- Thomas Bulfinch
|
|
0
|
|
|
|
Reply
|
roberson2 (8067)
|
7/1/2008 10:54:58 AM
|
|
|
1 Replies
97 Views
(page loaded in 0.058 seconds)
Similiar Articles: ASM to C - comp.lang.asm.x86... has to have been created in C, compiled ... are one of the most effective ... Why gcc translate a c program into assemble as follow - comp.lang ... A C function is like ... Are newbie questions OK in here? - comp.lang.asm.x86> MSVC breaking the C(++) standard this way was a bit ... What if the surrounding function had x as a dummy argument and was compiled for ... can'y use "__asm" *inside* a C program ... GUI for Fortran programs - comp.lang.fortranA function call will always be more efficient. Also, if the callback needs to pass ... program. Else, one needs to design a way to pass ... program after having compiled ... improve strlen - comp.lang.asm.x86... work better than mine i have compiled with gcc -O3 str.c ... time in a sense that it is a good way to pass ... well-written assembly language function in a HLL like C/C++. Difference between passing a number and a variable to a subroutine ...I am currently working on a program that has to pass ... Fortran compilers try to be efficient, they almost always pass ... va_list by reference to a function - comp.lang.c ... Projection-state of gl_Vertex in GLSL - comp.graphics.api.opengl ...The problem is: - I am transferring 4 uniforms to pass ... to use texture, because I was sure it was more efficient ... I do believe that's the way NGs work. > I ... Displaying Images - comp.lang.java.guiI'm writing a rather complex GUI program using ... but as far as I can tell, the only way these images get compiled into ... Put the image file (kittens.jpg in my case ... speed issues traversing the DOM. - comp.lang.javascriptIn a compiled language and element like a ... Why to pass time to test other obscure ... code *****/ function fly(that) { // not the more efficient way to ... x86-64 and calling conventions - comp.compilers... be limited in terms of what they can pass along ... that registers have to be allocated in effective ... outright stopping you from defining your function signatures in a way ... Dos and don'ts in C++ unit testing? - comp.lang.c++.moderated ...... ve found the CppUnit framework to be effective ... the interface to such a resource, and pass ... that many functions do "group" in some way; that the results of one function ... C (programming language) - Wikipedia, the free encyclopedia... written C program can be compiled for a very wide ... Therefore, although function calls in C use pass-by-value ... often written in C because C compilers generate efficient ... Compiler - Wikipedia, the free encyclopediaIf the compiled program can run on a ... to a special evaluation function. To implement these features in a compiled ... so that they could be compiled in a single pass (e ... 7/18/2012 5:25:52 PM
|
|
|
|
|
|
|
|
|