Rank: 144 based on 597 downloads (last 30 days) and 12 files submitted
photo

Ohad Gal

E-mail

Personal Profile:

B.Sc in Electrical Engineering (signal processing, telecommunication and optics),
M.Sc in Electrical Engineering - Thesis in Optical fiber telecommunication

Professional Interests:

 

Watch this Author's files

 

Files Posted by Ohad View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
07 Nov 2005 Screenshot browseforfolder Enhanced dialog box for folder browsing. Author: Ohad Gal gui tools, example, ui, browse, folder, utilities 13 1
  • 3.0
3.0 | 1 rating
22 Nov 2004 Screenshot updownsample up/down sample an input matrix using the fourier domain. Author: Ohad Gal geometric transformat..., image registration, upsample downsample f... 26 5
  • 4.71429
4.7 | 7 ratings
29 Apr 2004 Screenshot A Collection of Fitting Functions A collection of fitting functions for various distributions. Author: Ohad Gal approximation, interpolation, fit, normal, maxwell, rayleigh 86 18
  • 4.38889
4.4 | 18 ratings
06 Jan 2004 JPEG Compression An example for jpeg compression and the restoration. Author: Ohad Gal compression, jpeg, function, image processing, dct transform 129 54
  • 4.27273
4.3 | 66 ratings
30 Oct 2003 get_non_default_value Finds the fields (of a UI element) with the non-default values. Author: Ohad Gal gui tools, example, default, value, graphic, ui 7 0
Comments and Ratings on Ohad's Files View all
Updated File Comment by Comments Rating
21 Sep 2014 updownsample up/down sample an input matrix using the fourier domain. Author: Ohad Gal Konnik, Mikhail

@ David Felguera

Well, technically speaking the code is correct - in terms of what _exactly_ is it doing. The code claims to do downSAMPLING, which is just throwing away specified frequencies. Unlike the _decimation_, which uses the low-pass filtering to mitigate the downsampling effects (slower and more complicated).

The effect that you experiencing in this example is called ringing, and this exactly what happens in up/downsampling without filtering.

21 Sep 2014 updownsample up/down sample an input matrix using the fourier domain. Author: Ohad Gal Konnik, Mikhail

26 Aug 2014 fit_ellipse Find the best fit for an ellipse using a given set of points (a closed contour). Author: Ohad Gal Lucy

26 Aug 2014 fit_ellipse Find the best fit for an ellipse using a given set of points (a closed contour). Author: Ohad Gal Lucy

I can't plot the ellipse. Could please anyone give me an explanation on how to use the code? Thanks

09 Jul 2014 fit_ellipse Find the best fit for an ellipse using a given set of points (a closed contour). Author: Ohad Gal Christian

For my tasks this function works better than the others I've tried so far. Thank you very much Ohad!!

@Aritra: To run this function on a binary image you have to run:
[X Y] = ind2sub(size(img),find(img));
E = fit_ellipse(x,y);

then you can do:
if E.long_axis > 0
[X, Y] = calcEllipse(E, 360);
end

To plot it the ellipse:
plot(Y, X);

The function calcEllipse:
function [X,Y] = calcEllipse(varargin)
% function [X,Y] = calculateEllipse(x, y, a, b, angle, steps)
%# This functions returns points to draw an ellipse
%#
%# @param x X coordinate
%# @param y Y coordinate
%# @param a Semimajor axis
%# @param b Semiminor axis
%# @param angle Angle of the ellipse (in rad)
%#
% Source: http://stackoverflow.com/questions/2153768/draw-ellipse-and-ellipsoid-in-matlab/24531259#24531259
% Modified by Christian Fässler

steps = 360;

if nargin == 1 || nargin == 2
x = varargin{1}.X0_in;
y = varargin{1}.Y0_in;
a = varargin{1}.a;
b = varargin{1}.b;
angle = varargin{1}.phi;
if nargin == 2
steps = varargin{2};
end
else if nargin == 5 || nargin == 6
x = varargin{1};
y = varargin{2};
a = varargin{3};
b = varargin{4};
angle = varargin{5};
if nargin == 6
steps = varargin{6};
end
else
error('Wrong input');
end
end

beta = -angle;
sinbeta = sin(beta);
cosbeta = cos(beta);

alpha = linspace(0, 2*pi, steps)';
sinalpha = sin(alpha);
cosalpha = cos(alpha);

X = round(x + (a * cosalpha * cosbeta - b * sinalpha * sinbeta));
Y = round(y + (a * cosalpha * sinbeta + b * sinalpha * cosbeta));

if nargout==1, X = [X Y]; end
end

Contact us