Jump to content
Sign in to follow this  
d0n

Getting part of an image

Recommended Posts

d0n

So i have an image, it is formatted in a grid format like so

[] [] [] [] []

[] [] [] [] []

[] [] [] [] []

[] [] [] [] []

what i want to do is, depending on where the red part is extract only a 3x3 square of that specific image

[] [] []

[] [] []

[] [] []

which function should i use to split the image into an X and Y coords (So the red in this example would be in X=3, Y=1)

Edited by d0n

Share this post


Link to post
Share on other sites
Malkey

So i have an image, it is formatted in a grid format like so

[] [] [] [] []

[] [] [] [] []

[] [] [] [] []

[] [] [] [] []

what i want to do is, depending on where the red part is extract only a 3x3 square of that specific image

[] [] []

[] [] []

[] [] []

which function should i use to split the image into an X and Y coords (So the red in this example would be in X=3, Y=1)

I assume the coordinate system you are using is :-

X an Y coordinates are both zero based.

With reference to the top format pattern with 20 grids,

zero X is the left hand column, increasing to the right , and

zero Y is the bottom row increasing upwardly.

This makes the red square X=3, Y=1.

So, if a 3x3 square was extracted using the coordinate X=2, Y=1, from your 20 grid example, then I assume the pixel at coordinate X=3, Y=1.would appear left of center of the 3x3 square.

or

Does the image you have, have the height divided into 4 row and the width divided into 5 column. And, when you select one of the 6 internal grid areas, the 3x3 square you extract contains 9 /20 th of the image?

What format is the extracted 3x3 square?

Is it an image to be saved as a jpg file? or,

9 pixels?, or,

something else?

The answer to these questions may help someone else figure out which function you should use.

Share this post


Link to post
Share on other sites
d0n

the image is more than 9 pixels, i think each square is about 9 pixel itself

then there is a black boarder around it, then some spacing between each square.

The X and Y are zero based so from my example of 20 squares the red is located at X = 3 and Y = 1

zero X is the left hand column, increasing to the right , and

zero Y is the bottom row increasing upwardly.

the image is in JPG format

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×