Jump to content
IGNORED

Where to find picture morphing software/freeware?


Recommended Posts

You could program one yourself. For instance in Matlab. First build an edge-detector. Then write an algorithm to morph the edges of the two pics. Then do some clever stuff with the coloring. Somewhere along the line you will need some form of interpolation as well. Linear is good enough under most circumstances.

 

If you do it right, you can make money with it!

  On 12/13/2011 at 7:36 PM, goDel said:

You could program one yourself. For instance in Matlab. First build an edge-detector. Then write an algorithm to morph the edges of the two pics. Then do some clever stuff with the coloring. Somewhere along the line you will need some form of interpolation as well. Linear is good enough under most circumstances.

 

 

have you done such morphing? how do you interpolate between the pics?

 

i've done some gfx in matlab but wouldn't know where to start with that--matrix manipulation?

 

example file pls?

  On 12/13/2011 at 7:38 PM, iep said:
  On 12/13/2011 at 7:36 PM, goDel said:

You could program one yourself. For instance in Matlab. First build an edge-detector. Then write an algorithm to morph the edges of the two pics. Then do some clever stuff with the coloring. Somewhere along the line you will need some form of interpolation as well. Linear is good enough under most circumstances.

 

 

have you done such morphing? how do you interpolate between the pics?

 

i've done some gfx in matlab but wouldn't know where to start with that--matrix manipulation?

 

example file pls?

 

Here a bit of code i've done years ago.

 

It basically maps a pixels from one image to another and is a function you can use in all kinds of circumstances. Rotation, translation, resizing. There are two versions of interpolation implemented.

 

I might have some edge detector lying around as well.

function color = pixelValue ( image , x, y, method )
% pixel value at real coordinates

if inImage (size ( image ),x,y)
% do the interpolation
switch ( method )
	case 'nearest'
		%Do nearest neighbour
		x = floor(x + 0.5);
		y = floor(y + 0.5);
		color = image(x,y);
		return;
	case 'bilinear'
		% Do bilinear interpolation
		x1 = floor(x);
		y1 = floor(y);
		x2 = x1+1;
		y2 = y1+1;

		% handling pixels on the border
		[row,col] = size(image);
		if x2 > row
			x2 = x1;
		end
		if y2 > col
			y2 = y1;
		end

		alfa = x - x1;
		beta = y - y1;

		color = ((1 - alfa)*(1 - beta)*image(x1, y1)) + ...
				(alfa *(1 - beta)*image(x1,y2))+ ...
				((1 - alfa)*beta *image(x2,y1))+ ...
				(alfa * beta * image(x2, y2));  

		return;
end %end switch

else
% return a constant '-1' if pixelcoordinate not in original
color = -1;
return;
end
end
function result = inImage(size, x, y)
xmax = size(:,1);
ymax = size(:,2);

result = 0;

% image array starts with 1
if(x>=1 & x<= xmax)
	if(y>=1 & y <= ymax)
		result = 1;
		return;
	end
end
end

 

In the current implementation it works only with black/white images. If you want colors the result should be a vector instead of a single value.

Edited by goDel
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   1 Member

×
×