Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Superimpose an image on an other at random positions

Subject: Superimpose an image on an other at random positions

From: Kevin

Date: 28 May, 2013 16:57:05

Message: 1 of 3

Hello Matlab community,

My goal is to superimpose a small image (A) 8x8 px on a larger image (B) 240x240 px.
A has to be superimpose at random positions on B, n times.
A1, A2,... An can't overlap. So I thought that random sampling positions without replacement would do the trick (900 possibilities).
On the paper, it is clear.
But when it comes to coding, I'm lost. For my first time coding in Matlab, I would have aimed for something easier.

So any help/hints is appreciated.

K.

Subject: Superimpose an image on an other at random positions

From: Image Analyst

Date: 30 May, 2013 01:07:11

Message: 2 of 3

Kevin
It's not hard. Just do

bigImage(row1:row2, col1:col2) = smallImage;

You just have to figure out what row1, etc. is. Not hard at all.

Subject: Superimpose an image on an other at random positions

From: Kevin

Date: 3 Jun, 2013 09:34:11

Message: 3 of 3

"Image Analyst" wrote in message <ko68nv$os9$1@newscl01ah.mathworks.com>...
> Kevin
> It's not hard. Just do
>
> bigImage(row1:row2, col1:col2) = smallImage;
>
> You just have to figure out what row1, etc. is. Not hard at all.

Thanks for the tip Image Analyst.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us