Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Can't get the correct degree within two images
Replies: 16   Last Post: Apr 16, 2009 5:56 AM

 Messages: [ Previous | Next ]
 khoo Posts: 63 Registered: 8/9/08
Re: Can't get the correct degree within two images
Posted: Apr 16, 2009 5:56 AM

"Dave Robinson" <dave.robinson@somewhere.biz> wrote in message <gs6r6g\$g5q\$1@fred.mathworks.com>...
> "khoo" <jim_khoo@hotmail.com> wrote in message <gs2eif\$5o1\$1@fred.mathworks.com>...
> > Bro Dave, one more question wanna ask you, if using only 2D images, can use the code also ?? cause i try it and get the wrong angle..actually the png image is 2D in my pc one..may be u take down from internet and become 3D image ady..so wanna ask you if use 2D image, still can use the program?
>
> Sorry for the delay answering you, but I have been doing holiday things, and not been near my computer.
>
> I am at a loss to understand why I can use my code and get the correct results, and if you are using my code, using similar images, you get something different. The only suggestion I have here, is if you copied my code into your code, you had some finger trouble somewhere and copied something over incorrectly. Sounds of guessing wildly, when putting in the new code for calculating the x & y gradients, did you notice the ' symbol difference between the x and y gradients. This is the transpose operator and is crucial, but small enough to miss.
>
> I guess by 2D images, you are referring to monochrome (grey scale) images as against 3D colour images. The answer is yes there is no difference in the basic operation of the code - but of course you need to bypass the code containing the rgb2gray() functions. Maybe you could automate that with something that looked like: -
>
> [rows.columns,planes] = size(myImage);
> if(planes ==3)
> % Colour Image
> myImage_Grey = rgb2gray(myImage);
> else
> %Grey scale Image
> myImage_Grey = myImage;
> end
>
> If I understand you regarding your 20 images. I don't see any problem. The way I would tackle it is to turn the angle processing code into a function.
>
> function Corrected image = DoAngleImage(Reference_Image,Twisted_Image)
>
> and put this into a loop
>
> for i=1:20
> % Get image pair
> ... ... ...
> Corrected_image_i = DoAngleImage(Reference_Image_i,Twisted_Image_i);
> end;
>
> If you search this collaboratory, there are lots of threads on how to extract and save images within a loop.
>
> Hope that helps
>
> Regards
>
> Dave Robinson

thx a lot bro dave, i will try it..if still can't i will come back here and ask you again..really thx alot

Date Subject Author
4/12/09 khoo
4/12/09 ImageAnalyst
4/13/09 Dave Robinson
4/13/09 Chaos
4/13/09 Dave Robinson
4/13/09 khoo
4/14/09 khoo
4/14/09 khoo
4/14/09 Dave Robinson
4/14/09 khoo
4/14/09 khoo
4/14/09 Dave Robinson
4/14/09 khoo
4/14/09 khoo
4/14/09 khoo
4/16/09 Dave Robinson
4/16/09 khoo