Digital Image Processing Using Scilab Pdf Apr 2026
Would you like a ready-to-download PDF version of this article? Copy this content into any word processor and export as PDF, or use a browser’s print-to-PDF feature.
// 3. Denoise with median filter img = medfilt2(img, [3 3]);
// Get image dimensions (rows, cols, channels) size(img) gray_img = rgb2gray(img); imshow(gray_img); 3.3 Access and Modify Pixels // Access pixel at row 100, column 150 pixel = img(100, 150, :); // Set a region of interest to black img(50:100, 50:100, :) = 0; 4. Image Enhancement 4.1 Histogram Equalization Improves contrast by spreading intensity values. digital image processing using scilab pdf
// Apply filter F_filtered = F_shifted .* H; F_restored = ifftshift(F_filtered); filtered_img = abs(ifft2(F_restored)); imshow(uint8(filtered_img)); // Full image processing pipeline function processed = process_image(path) // 1. Read img = imread(path); // 2. Convert to grayscale if size(img, 3) == 3 img = rgb2gray(img); end
Article ID: DIP-SCILAB-01 Target Audience: Engineering students, researchers, hobbyists Software Required: Scilab 6.1+ with SIVP (Scilab Image and Video Processing) toolbox 1. Introduction Digital Image Processing (DIP) involves manipulating digital images using computer algorithms. While MATLAB is the industry standard, Scilab —a free, open-source alternative—provides powerful capabilities for DIP through its SIVP (Scilab Image and Video Processing) toolbox and core functions. Would you like a ready-to-download PDF version of
// Closing (dilation followed by erosion) closed = imclose(binary, se); 8.1 Simple Thresholding // Global threshold threshold = 120; segmented = gray_img > threshold; imshow(segmented); 8.2 Otsu’s Thresholding // Compute Otsu threshold automatically [level, intensity] = otsu_thresh(gray_img); bw_otsu = gray_img > level; 8.3 Connected Components Labeling [labeled_img, num_objects] = bwlabel(bw_otsu); disp("Number of objects detected: " + string(num_objects)); 9. Fourier Transform for Frequency Domain Processing // Compute FFT F = fft2(double(gray_img)); F_shifted = fftshift(F); // Magnitude spectrum magnitude = log(abs(F_shifted) + 1); imshow(magnitude, []);
// 5. Edge detection sobel_x = [-1 0 1; -2 0 2; -1 0 1]; Gx = imfilter(double(img), sobel_x); Gy = imfilter(double(img), sobel_x'); edges = sqrt(Gx.^2 + Gy.^2); Denoise with median filter img = medfilt2(img, [3
// Low-pass filter in frequency domain [m, n] = size(gray_img); cx = m/2; cy = n/2; radius = 30; H = zeros(m, n); for i = 1:m for j = 1:n if sqrt((i-cx)^2 + (j-cy)^2) <= radius H(i, j) = 1; end end end
// Install SIVP from ATOMS (Scilab’s package manager) atomsInstall("SIVP") // Restart Scilab after installation // Load the toolbox exec("SCI/modules/sivp/macros/sivp_loader.sce", -1) Alternatively, use core functions ( imread , imshow , imwrite ) available in recent Scilab versions. 3.1 Read, Display, and Write Images // Read an image img = imread('camera.jpg'); // Display image imshow(img);
// 6. Threshold processed = edges > 50; imshow(processed); end