# Flipping images

## Flipping images

Is there an app function to simply flip images vertically / horizontally ?

I see there is funtion to do rotate and mirror. but nothing about flipping.

Shashi

13 Beiträge / 0 neu
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

Can't you use mirror function to flip across any particular axis?

Mirror function mirros the image around vertical or horzontal axis, ie it mirros from the center of the image. is there a way to adjust mirror position not be the center of the image?

All I want is vertical and horizontal flips.Tried mirror, its not what i want.

Hi,

Could you be more specific? Suppose you have
p00 p01 p02 p03
p10 p11 p12 p13
p20 p21 p22 p23
p30 p31 p32 p33
What image dou you want to get finally?

Regards,
Sergey

Regards, Sergey

Horizontal flipping is simply reversing every element in each row (sawpping coulms), vertical flipping is reversing every element in each column(swapping rows)

.after vertical flip it will be

p30 p31 p32 p33

p20 p21 p22 p23

p10 p11 p12 p13

p00 p01 p02 p03

Horizontal flip will result in

p03 p02 p01 p00

p13 p12 p11 p10

p23 p22 p21 p20

p33 p32 p31 p30

Hope that makes sense.

Shashi

Hi Shashi,

Isn't it what ippiMirror is doing?

Regards,
Sergey

Regards, Sergey

Hi everybody,

>>...Isn't it what ippiMirror is doing?

Exactly. Take a look at a set of Image Processing functions ippiMirror_xxx ( Vertical, Horizontal, or both flips are supported ). Sorry that it took so long to answer your question.

I looked at Mirror function and used it to see what it does before I asked the question here. It mirros the first half of the image into the second half if I pass Dest and source the same image.

I can make Mirror work by doubling the size of the input and filling only the first half of the image and using a destintation half as much as the source, like its showed in the sample in documnetation.

I was hoping there is a flip image which workds without having to double the image size and pad.

Shashi

Description in the ippi.h header file doesn't say anything that pSrc could be equal to pDst. So, this is clearly Not In-place transformation.

Even then, if you pass a Source 10 X 10 image and pass an empty 10X 10 dest image, Dest image will be filled with sourceimage mirrored at centerline vertically / horzontally / bothway depending on the what flag you pass.

To make the flip image work you have to pad the input to twice the size padding on the right or bottom based on which flip you want.

and use half size Dest. Effectively you are mirroring the enitre image that is of interest.

That's why I asked in the very biggning is there a way to specify the position of the mirror, other than its default to center of the image..

Shashi

No, I don't understand. Shashi, could you describe your desired image in terms of Pxy matrix? Again, let's you have
p00...p03
...
p30...p33

Regards,
Sergey

Regards, Sergey

>>...Even then, if you pass a Source 10 X 10 image and pass an empty 10X 10 dest image, Dest image will be filled with
>>sourceimage mirrored at centerline vertically / horzontally / bothway depending on the what flag you pass...

If your images are so small could you post a real example, I mean the Source and Destination ( after processing ) images?

HI there

Here is a code for image flipping:

```namespace RE__Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
string fileName = "c:/Sample.png";

REImage reImage = REFile.OpenImageFile(fileName);

ImageProcessing.ApplyFlipV(reImage);

REFile.SaveImageFile(reImage, "c:/reimage.png", new PNGEncoder());```
Be happy (*^__^*)

## Kommentar hinterlassen

Bitte anmelden, um einen Kommentar hinzuzufügen. Sie sind noch nicht Mitglied?