how can this function "resizeColumnscore" resizes image? - matlab

I want to know how can this function(from MATLAB) resize the columns of an input image using weights an indices previously computed.
Which equations uses to do that?
resizeColumnsCore(double(in), weights', indices');

When I looked for a function called resizeColumnsCore in MATLAB 7.11.0 (R2010b) I didn't find anything. However, I did find a MEX-file by that name in MATLAB 7.8.0 (R2009a) in this subdirectory of the Image Processing Toolbox:
C:\Program Files\MATLAB\R2009a\toolbox\images\images\private\
I guess they've phased it out or replaced it with another function in newer MATLAB versions. Now, if you want to know what the MEX-file does, you need to look at the source code it is compiled from. Luckily, it appears that this source code resizeColumnsCore.cpp can be found in the following directory:
C:\Program Files\MATLAB\R2009a\toolbox\images\images\private\src\misc\
And you can look through that code to determine the algorithms used to resize the columns of an image given a set of weights and indices.
Now, if you want to know how these input arguments to resizeColumnsCore are computed, you'll have to look at the code of a function that calls it. I know of at least one function in the IPT that calls this function: IMRESIZE. If you type edit imresize at the command prompt it will open that function in the Editor, allowing you to look through the code so you can see how the arguments to resizeColumnsCore are created.
What I can tell you for R2009a is that there is a subfunction in the file imresize.m called contributions which computes the weights and indices that are ultimately passed as arguments to resizeColumnsCore. That is where you will want to start looking to determine what algorithms are used to compute these arguments.

Looks like this isn't a proprietary MATLAB function. Could we see some code or a link to the code?

Related

Call dll function from matlab

I have an m file from which I use to create dll using the Matlab deploytool. the code simply reads as:
function hello
disp('Hello')
end
there are six functions in the compiled dll exported as:
uint8 helloInitialize
[uint8, voidPtr, voidPtr] helloInitializeWithHandlers(voidPtr, voidPtr)
helloPrintStackTrace
helloTerminate
uint8 mlfHello
[uint8, MATLAB arrayPtr, MATLAB arrayPtr] mlxHello(int32, MATLAB arrayPtr, int32, MATLAB arrayPtr)
Now I want to run this dll from my matlab command window using calllib and use
the hello function. Assuming that I use the correct function mlfHello, calllib('hello','mlfHello') gives me nothing. Please advise me on what function to call and how to do it?
I'm not 100% its still the case but it certainly used to be that you couldn't load DLL's which were created in Matlab back into Matlab.
I suspect its still the case - so you cant do what your trying to do.
[edit] I dont have a link because they dont like to advertise the fact. The reason AFAIK is to avoid users compiling toolbox capability into DLL and giving to others to use in Matlab without a toolbox license.

Matlab, how to see the source code of the function mean()?

I know some built-in functions cannot be accessed in Matlab, but is that true for all functions even simple ones?
Can I see somewhere the source code of the predefined function mean(), and in case of complex numbers z^5 all 5 solutions for the complex number (because Matlab displays just one solution) ?
Type "edit mean" into the command window.

How to use image fusion function in matlab?

I = imread('baboon.jpg')
Inimage = imguidedfilter(I)
imshow(Inimage)
Error: Undefined Function imguidedfilter
But when I search there appears to be a function by this name. Why?
MATLAB is regularly updated with new functions, and there are also multiple toolboxes (with their own updates). So the functions you can use depends on your version of MATLAB. Unfortunately it is not easy to find out in which version of MATLAB a function first became available.
You can use these functions to get some more information:
ver - to see what MATLAB version you have and which which toolboxes you have access to.
which - to see if a particular function is on your MATLAB path
e.g. which imguidedfilter will show you if you have access to the function imguidedfilter.
This particular function appears to be a very new function which you may need R2014a for (as I have R2013b and Image Processing Toolbox and don't have it).

Matlab Simulink function

I am building a reduced order observer in MATLAB. The matrices are calculated using functions/script files outside matlab and simulink function blocks are using these functions to calculate values.
The problem is that some commands like 'acker', 'place' etc which used to work on command window/function/script files are not working in simulink function block and showing errors.
I tried using simin block to take these matrices from workspace but it is also showing errors which I can't understand.
Thanks for your help.
If I get your question correctly then, from User defined functions, you could add a Matlab function block with the following code:
function fcn(in)
%#codegen
coder.extrinsic('acker', 'place')
# Now you can use acker, place so add more code.

What is the algorithm of Skeleton

This function bwmorph(Img,'skel',Inf) return the skeleton of a binary image.
What I'm looking for is the algorithm used by this function to do it manualy ?
The documentation gives an overview of the algorithm (scroll down a ways).
If you want to see the actual code within a function in MATLAB, you can try using the TYPE command:
type bwmorph %# Command form
type('bwmorph.m') %# Function form
Keep in mind, this will not work on all MATLAB functions. You may get a message that says the function is a built-in function, in which case the code will not be displayed. You can also try opening the file in the MATLAB Editor using the EDIT command:
edit bwmorph.m %# Command form
edit('bwmorph.m') %# Function form