HỌC VIỆN CÔNG NGHỆ BƯU CHÍNH VIỄN THÔNG                   KHOA: VIỄN THÔNG 2               NGÀNH: ĐIỆN TỬ - VIỄN THÔNGMôn ...
Danh sách sinh viên thực hiện :Nguyễn Thành Tài : Nhóm TrưởngLí Trấn ĐôngHuỳnh Bảo PhúLê Hồng ThànhNguyễn Hoàng Duy MinhHồ...
Tách ảnh trắng đen ra hai phần LSB và MSBẢnh gốc :ảnh kết quả :                MSB                       LSB
Để chạy chương trình ta thực hiện các bước sau :Bước 1 : copy file bit_plane_32 ra một thư mục khácBước 2 : nhấn double cl...
Bước 7 : nhấn vào nút msb để xem mặt phẳng ảnh – sau đó ảnh xuất hiện                     Code để chương trình chạy :funct...
%      unrecognized property name or invalid value makes property application%      stop. All inputs are passed to bit_Ope...
gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before bit is made visib...
% eventdata reserved - to be defined in a future version of MATLAB% handles      structure with handles and user data (see...
% handles    structure with handles and user data (see GUIDATA)link = get(handles.edit_link,String);image_rgb = imread(lin...
image_rgb = imread(link);image_gray = rgb2gray(image_rgb);image_bit_lsb = bitget(image_gray,1);figure(1);imshow(image_bit_...
% Hints: get(hObject,String) returns contents of edit_link as text%       str2double(get(hObject,String)) returns contents...
image_bit_msb = bitget(image_gray,8);lsb_msb=image_bit_msb + image_bit_lsb;figure(1);imshow(lsb_msb,[]);
Upcoming SlideShare
Loading in …5
×

Báo cáo nhóm 9

0 views
470 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
0
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Báo cáo nhóm 9

  1. 1. HỌC VIỆN CÔNG NGHỆ BƯU CHÍNH VIỄN THÔNG KHOA: VIỄN THÔNG 2 NGÀNH: ĐIỆN TỬ - VIỄN THÔNGMôn : XỬ LÍ HÌNH ẢNHĐề Tài : Tách ảnh đen trang ra thành 2 mặt phẳng LSB và MSB GVHD : Ts Nguyễn Thanh Bình LỚP : L11CQVT-N SVTH : Nhóm 9
  2. 2. Danh sách sinh viên thực hiện :Nguyễn Thành Tài : Nhóm TrưởngLí Trấn ĐôngHuỳnh Bảo PhúLê Hồng ThànhNguyễn Hoàng Duy MinhHồ Minh Quân
  3. 3. Tách ảnh trắng đen ra hai phần LSB và MSBẢnh gốc :ảnh kết quả : MSB LSB
  4. 4. Để chạy chương trình ta thực hiện các bước sau :Bước 1 : copy file bit_plane_32 ra một thư mục khácBước 2 : nhấn double clich vào files trên sau khi cài đạt xongBước 3 : chay file bit_plane_32.exeBước 4 : xuất hiện hộp thoạiBước 5 : nhấn vào open chọn đường dẫn của files hình ànhBước 6 : nhấn vào nút lsb để xem mặt phẳng ảnh - sau do ành sẽ xuất hiện :
  5. 5. Bước 7 : nhấn vào nút msb để xem mặt phẳng ảnh – sau đó ảnh xuất hiện Code để chương trình chạy :function varargout = bit(varargin)% BIT MATLAB code for bit.fig% BIT, by itself, creates a new BIT or raises the existing% singleton*.%% H = BIT returns the handle to a new BIT or the handle to% the existing singleton*.%% BIT(CALLBACK,hObject,eventData,handles,...) calls the local% function named CALLBACK in BIT.M with the given input arguments.%% BIT(Property,Value,...) creates a new BIT or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before bit_OpeningFcn gets called. An
  6. 6. % unrecognized property name or invalid value makes property application% stop. All inputs are passed to bit_OpeningFcn via varargin.%% *See GUI Options on GUIDEs Tools menu. Choose "GUI allows only one% instance to run (singleton)".%% See also: GUIDE, GUIDATA, GUIHANDLES% Edit the above text to modify the response to help bit% Last Modified by GUIDE v2.5 15-Oct-2012 19:47:14% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, ... gui_Singleton, gui_Singleton, ... gui_OpeningFcn, @bit_OpeningFcn, ... gui_OutputFcn, @bit_OutputFcn, ... gui_LayoutFcn, [] , ... gui_Callback, []);if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});endif nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else
  7. 7. gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before bit is made visible.function bit_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to bit (see VARARGIN)% Choose default command line output for bithandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes bit wait for user response (see UIRESUME)% uiwait(handles.figure1);% --- Outputs from this function are returned to the command line.function varargout = bit_OutputFcn(hObject, eventdata, handles)% varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure
  8. 8. % eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Get default command line output from handles structurevarargout{1} = handles.output;% --- Executes on button press in open.function open_Callback(hObject, eventdata, handles)% hObject handle to open (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)[filename, pathname, filterindex]=uigetfile( ... {*.jpg,JPEG — Joint Photographic Experts Group (*.jpg); ... *.png,PNG — Portable Network Graphics (*.png); ... *.bmp,BMP — Windows Bitmap (*.bmp);... *.*,All file (*.*)}, ... Open picture);link = strcat(pathname,filename);set(handles.edit_link,String,link);% --- Executes on button press in source.function source_Callback(hObject, eventdata, handles)% hObject handle to source (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB
  9. 9. % handles structure with handles and user data (see GUIDATA)link = get(handles.edit_link,String);image_rgb = imread(link);figure(1);imshow(image_rgb);% --- Executes on button press in gray.function gray_Callback(hObject, eventdata, handles)% hObject handle to gray (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)link = get(handles.edit_link,String);image_rgb = imread(link);image_gray = rgb2gray(image_rgb);figure(1);imshow(image_gray);% --- Executes on button press in lsb.function lsb_Callback(hObject, eventdata, handles)% hObject handle to lsb (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)link = get(handles.edit_link,String);
  10. 10. image_rgb = imread(link);image_gray = rgb2gray(image_rgb);image_bit_lsb = bitget(image_gray,1);figure(1);imshow(image_bit_lsb,[]);% --- Executes on button press in msb.function msb_Callback(hObject, eventdata, handles)% hObject handle to msb (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)link = get(handles.edit_link,String);image_rgb = imread(link);image_gray = rgb2gray(image_rgb);image_bit_msb = bitget(image_gray,8);figure(1);imshow(image_bit_msb,[]);function edit_link_Callback(hObject, eventdata, handles)% hObject handle to edit_link (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)
  11. 11. % Hints: get(hObject,String) returns contents of edit_link as text% str2double(get(hObject,String)) returns contents of edit_link as a double% --- Executes during object creation, after setting all properties.function edit_link_CreateFcn(hObject, eventdata, handles)% hObject handle to edit_link (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,BackgroundColor),get(0,defaultUicontrolBackgroundColor)) set(hObject,BackgroundColor,white);end% --- Executes on button press in lsb_msb.function lsb_msb_Callback(hObject, eventdata, handles)% hObject handle to lsb_msb (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)link = get(handles.edit_link,String);image_rgb = imread(link);image_gray = rgb2gray(image_rgb);image_bit_lsb = bitget(image_gray,1);
  12. 12. image_bit_msb = bitget(image_gray,8);lsb_msb=image_bit_msb + image_bit_lsb;figure(1);imshow(lsb_msb,[]);

×