Memuat
Memuat
Otsu Thresholding and Segmentation for Robotics and Mechatronics
0 views
Apply Otsu thresholding to the track line image while tuning the otsu threshold and the illumination level to assess processing quality. Otsu thresholding automatically chooses an intensity threshold separating object and background by minimising within-class variance. It is used as a first segmentation step, followed by cleaning and labelling objects.

Apply Otsu thresholding to the track line image while tuning the otsu threshold and the illumination level to assess processing quality.
| Role | Variable | Unit |
|---|---|---|
| Main | Track line image | - |
| Supporting 1 | Otsu threshold | - |
| Supporting 2 | Illumination level | lux |
The Otsu threshold of 0.463 separates objects from background in Track line image with a Dice coefficient of 0.992 and pixel accuracy of 0.999; the foreground covers 8.9% of the image in 7 components.
Computed from illustrative synthetic data, not from a real study.
Otsu thresholding automatically chooses an intensity threshold separating object and background by minimising within-class variance. It is used as a first segmentation step, followed by cleaning and labelling objects.
Report the threshold, the number of objects, and the size of segmented objects plus a quality measure such as Dice. Explain the method's limits under uneven illumination.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
rng(2);
[xx, yy] = meshgrid(1:256);
truth = ((xx-60).^2 + (yy-70).^2 < 25^2) | ((xx-150).^2 + (yy-80).^2 < 30^2) | ((xx-110).^2 + (yy-190).^2 < 35^2);
otsu_threshold = 0.3 * xx / 256; % uneven background gradient
track_line_image = mat2gray(0.25 + 0.4*truth + otsu_threshold + 0.06*randn(256));
level = graythresh(track_line_image);
bw = imbinarize(track_line_image, level);
bw = bwareaopen(bw, 100);
bw = imfill(bw, 'holes');
bwa = imbinarize(track_line_image, adaptthresh(track_line_image, 0.4)); % adaptive threshold for comparison
dice = @(a, b) 2*nnz(a & b) / (nnz(a) + nnz(b));
fprintf('Otsu level = %.3f\n', level);
fprintf('Dice (Otsu) = %.3f, Dice (adaptive) = %.3f\n', dice(bw, truth), dice(bwa, truth));
L = bwlabel(bw);
stats = regionprops(L, 'Area', 'Centroid');
fprintf('Objects found: %d, areas: %s\n', numel(stats), mat2str([stats.Area]));
figure;
subplot(1,3,1); imshow(track_line_image); title('Image');
subplot(1,3,2); imshow(bw); title('Otsu + cleaning');
subplot(1,3,3); imhist(track_line_image); hold on; xline(level, 'r', 'LineWidth', 1.5);Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$22
excl. 11% VAT
Duration: 3 working days
Output: MATLAB files + result figures
Deliverables
Package 2 · most chosen
US$66
excl. 11% VAT
Duration: 7 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$144
excl. 11% VAT
Duration: 12-15 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. Otsu Thresholding and Segmentation is commonly used at this level in Robotics and Mechatronics. We adapt the analysis to your research question, your own data and your supervisor's requirements.
No. The sheet is computed from illustrative synthetic data so you can see the kind of output MATLAB gives. For your order we run the same method on your own data.
That is the point of the packages. Every script is commented, and Package 3 includes two coaching sessions plus practice questions so you can explain the method and the results at your seminar and defence.
Each project has three packages: Package 1 (code and explanation) US$22, Package 2 (your data analysis and interpretation) US$66 and Package 3 (full guidance) US$144, excluding 11% VAT. Larger datasets, extra methods or tight deadlines adjust the quote after a short consultation.
The result sheet uses illustrative synthetic data. MATLAB is a trademark of The MathWorks, Inc.
Back to MATLAB portfolio