lazysnapping ~20x slower in 2022b compared to 2021b

4 Ansichten (letzte 30 Tage)
Jon Dudley
Jon Dudley am 20 Apr. 2023
I just upgraded from 2021b to 2022b and am getting a massive performance hit when calling the function lazysnapping. Code for a simple performance test is below; when I run it in 2021a it will average 0.072 seconds to complete but when I run it in 2022b (on the same computer) it will average 1.637 seconds to complete. Using Profiler, I can see that virtually all of the discrepancy comes from "lazysnapping>lazysnapping.computeTerminalEdgeWeights" lines 82 and 84.
Notably, the perfomance discrepancy between versions is worst when the image to segment is a 2D truecolor image. For 2D grayscale, 2022b is ~12 times slower. For 3D grayscale, 2022b is ~4 times slower.
RGB = imread('peppers.png');
L = superpixels(RGB,500);
foreground = false(384,512);
foreground(151:275,100:400) = true;
background = false(size(foreground));
background(1:20,1:512) = true;
tic
BW = lazysnapping(RGB,L,foreground,background);
toc
Elapsed time is 0.249120 seconds.

Antworten (0)

Produkte


Version

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by