when i add background image to my program, everything gets inverted, like my ball stars to bounce with the cieling rather than to floor. what error i am doing ? i am doing it by imread and imshow function.
and also how can i set the size of image to that is required?
Thank You :)
|
|
0
|
|
|
|
Reply
|
owais.ashraf (4)
|
4/21/2012 12:14:07 PM |
|
On Apr 21, 8:14=A0am, "Owais " <owais.ash...@live.com> wrote:
> when i add background image to my program, everything gets inverted, like=
my ball stars to bounce with the cieling rather than to floor. what error =
i am doing ? i am doing it by imread and imshow function.
> and also how can i set the size of image to that is required?
>
> Thank You :)
---------------------------------------------------------------------------=
--------
Try calling "cla reset" before you call imshow. That should upright
everything. One wild guess, you don't have your camera upside down do
you? Does your video look normal in other apps which use video?
To set the size, you can use
set(handlesToAxes, 'Position', [x y width height]);
|
|
0
|
|
|
|
Reply
|
imageanalyst (7590)
|
4/21/2012 3:52:16 PM
|
|
"Owais " <owais.ashraf@live.com> wrote in message <jmu8af$4cc$1@newscl01ah.mathworks.com>...
> when i add background image to my program, everything gets inverted, like my ball stars to bounce with the cieling rather than to floor. what error i am doing ? i am doing it by imread and imshow function.
> and also how can i set the size of image to that is required?
>
> Thank You :)
You have remembered that images label the TOP left pixel as 1,1, whereas normal cartesian coordinates would label the BOTTOM left corner of a graph/plot as 1,1, and so generating a sort of pictorial inversion?
Regards
Dave Robinson
|
|
0
|
|
|
|
Reply
|
dave.robinson (1276)
|
4/22/2012 2:43:06 PM
|
|
"Dave Robinson" wrote in message <jn15dp$lmn$1@newscl01ah.mathworks.com>...
> "Owais " <owais.ashraf@live.com> wrote in message <jmu8af$4cc$1@newscl01ah.mathworks.com>...
> > when i add background image to my program, everything gets inverted, like my ball stars to bounce with the cieling rather than to floor. what error i am doing ? i am doing it by imread and imshow function.
> > and also how can i set the size of image to that is required?
> >
> > Thank You :)
>
> You have remembered that images label the TOP left pixel as 1,1, whereas normal cartesian coordinates would label the BOTTOM left corner of a graph/plot as 1,1, and so generating a sort of pictorial inversion?
>
> Regards
>
> Dave Robinson
No I didn't knew about this pixel thing :/
|
|
0
|
|
|
|
Reply
|
owais.ashraf (4)
|
4/22/2012 5:13:06 PM
|
|
Yeah, but imshow() and other image display routines that that into
account seamlessly. I'm still betting on the camera being upside
down. With many machine vision cameras, they are just a rectangular
block so it's not obvious what is the top and what is the bottom.
|
|
0
|
|
|
|
Reply
|
imageanalyst (7590)
|
4/22/2012 6:19:46 PM
|
|
"ImageAnalyst" <imageanalyst@mailinator.com> wrote in message
news:4d2a43bf-b0f9-4655-a004-96efceb84488@2g2000yqp.googlegroups.com...
> Yeah, but imshow() and other image display routines that that into
> account seamlessly.
Yes, by changing the YDir property of the axes, which would cause the effect
the OP reported.
http://www.mathworks.com/help/techdoc/ref/axes_props.html#XDir
When called in its "high level" form, IMAGE does change the YDir property.
http://www.mathworks.com/help/techdoc/ref/image.html
figure; set(gca, 'YDir', 'normal'); hold on; image(rgb)
figure; set(gca, 'YDir', 'reverse'); hold on; image(rgb)
figure; image(rgb)
> I'm still betting on the camera being upside
> down. With many machine vision cameras, they are just a rectangular
> block so it's not obvious what is the top and what is the bottom.
If the camera were upside down, the ball the OP mentioned would still be
bouncing toward the floor, but the floor would be where the ceiling should
be and vice versa. I'm guessing the OP's trying to put a background image on
the figure created by the BALLODE demo to display the bouncing ball and
somehow the YDir property isn't being set as they expect.
--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
|
|
0
|
|
|
|
Reply
|
slord (13282)
|
4/23/2012 2:44:10 PM
|
|
Owais, did you, for some reason, change the YDIR property of your
axes, and then call "hold on", which would counteract the normal
operation of image() and imshow() and prevent them from working as
expected?
So we can check, what do you get when you say this:
currentYDirection = get(gca, 'YDir')
|
|
0
|
|
|
|
Reply
|
imageanalyst (7590)
|
4/23/2012 2:56:14 PM
|
|
|
6 Replies
41 Views
(page loaded in 0.114 seconds)
Similiar Articles: How to resize image using javascript codes - comp.graphics.apps ...Hi All, Could you pls help me how to resize image to particular proportion to load images faster on a web page. The images to be resized should be t... How to superimpose 2 image using MATLAB, thanks - comp.soft-sys ...Dear all, I want to show a heatmap (e.g. hm) on another image (e.g. im), how can I do this? I have tried the following codes: imagesc(hm), color... image recognition using neural network - comp.soft-sys.matlab ...hi, i'm using gui to create a recognition system to identify 2 classes. for training, i have 150 image- parameter already extracted stored in a tra... resize an image using linear or bicubic spline interpolation not ...Hi, The OpenGL function glPizelZoom allows to use the graphics pipeline to resize a mxn size image to m*k x n*l image using glPixelZoom, which just ... images matching using canny edge detection algorithm - comp.soft ...Hi all, I am trying to implement a project to compare the one image with the images in the database. In details a have a database of around 500 i... about edge detection of image using emd - comp.soft-sys.matlab ...hi i am doing project on edge detection using emd (empirical mode decomposition) method. i did some part of coding but i am not getting neat edge of image. image clustering with hidden Markov Model - comp.soft-sys.matlab ...I want a matlab code to classify a landsat image using hidden Markov model. I need some help . ... image fusion using laplacian pyramid - comp.soft-sys.matlab ...how to calculate cross entropy if the image ... ... If you provide the formula, and your attempt at coding it up in MATLAB, then we could correct your MATLAB code ... Image denoising using median of pixels - comp.soft-sys.matlab ...hello i ve to remove noise from gray scale image by using median of pixels.first a pixel is checked i.e.whether it is corrupted or not, if it is corru... Need K-Means Code for image segmentation - comp.soft-sys.matlab ...help, i need matlab code for image segmentation using k-means algorithm can anyone help me ... Wikipedia:Image use policy - Wikipedia, the free encyclopediaThis page is a brief overview of the policies towards images —including format, content, and copyright issues—on the English-language edition of Wikipedia. If you ... Photoshop Help | Adjusting crop, rotation, and canvas (CS5) - AdobeCropping is the process of removing portions of an image to create focus or strengthen the composition. You can crop an image using the Crop tool and the Crop command. 7/22/2012 6:32:40 PM
|