数字图像处理之几何变换

、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
imresize
 IMRESIZE Resize image.
    IMRESIZE resizes an image of any type using the specified
    interpolation method. Supported interpolation methods
    include:

         'nearest'  (default) nearest neighbor interpolation
 
         'bilinear' bilinear interpolation
 
         'bicubic'  bicubic interpolation

缩小

A=imread('lena.jpg');  
subplot(1,2,1);imshow(A);title('原图像'); 

B=imresize(A,0.1,'nearest');
subplot(1,2,2);imshow(B);title('zoom');


放大
A=imread('lena.jpg');  
subplot(1,2,1);imshow(A);title('原图像'); 

B=imresize(A,10,'nearest');
subplot(1,2,2);imshow(B);title('zoom');





、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
halcon几何变换
read_image (Lena, 'C:/Program Files/MVTec/HALCON-10.0/images/barcode/25industrial/25industrial07.PNG')

*     read_image (Lena, 'F:/image/lena.jpg')  
    get_image_size (Lena, Width, Height)  
*     dev_close_window ()  
*     dev_open_window (0, 0, Width/2, Height/2, 'black', WindowHandle)  
*     set_display_font (WindowHandle, 14, 'mono', 'true', 'false')  
*     dev_display (Lena)  
*     disp_continue_message (WindowHandle, 'black', 'true')  
*     stop ()  



access_channel(Lena, Image, 1)

* read_image(Image,'monkey')
zoom_image_size (Image, ZooImage, Width/8, Width/8, 'nearest_neighbor')

rotate_image(ZooImage, ImageRotate, -90, 'constant')

write_image (ImageRotate, 'png', 0, 'C:/Program Files/MVTec/HALCON-10.0/images/barcode/25industrial/25industrial08.PNG')




posted on 2012-03-25 04:32  _song  阅读(637)  评论(0编辑  收藏  举报