Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
content badge
swh:1:cnt:4394981727145a77031d9c13543c9159d821762d

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
(requires biblatex-software package)
Generating citation ...
%% Render speckles images
% Show how to use the rendering algorithm, and demonstrate the memory
% effect

% Build the target area
boxTargetArea = boxArea( ...
    1 ,             ... wavelength
    200,            ... MFP
    [0,2000],       ... z
    [-50000,50000], ... x
    [-50000,50000]  ... y
);

% g = 0.9 for strong ME. g = 0 will give weak ME.
scatter = HGScatter(0.9, 0.8);

% Light directions number, each direction is a different image
lightsNum = 5;

% Delta beween each direction (in degrees)
lightDelta = 0.0025;

lights = (0:1:(lightsNum-1)) * lightDelta;

% Create 101x101 image
pixNum = 101;

% For each lighting direction, we will set up 20 sensors
% The more sensorsToLight is bigger, the bigger speckles are, but less
% speckles will appear.
% It is also the numbet of pixels each speckle will move between lightings.
sensorsToLight = 20;

viewsVector = (-((pixNum-1)/2):1:((pixNum-1)/2)) * ...
    (lightDelta/sensorsToLight);

% Make views image
[X,Y] = meshgrid(viewsVector);

% The directions will be auto-normalized in the code
views = [sind(X(:).');sind(Y(:).');ones(1,numel(X))];

%% Run the code and get the rendered image
% Be careful not render the correlation matrix, since it has huge memory
% consuption

tic;
mulres = scmc(boxTargetArea, ...
    farFieldSource(views), ...
    farFieldSource(deg2rad(lights),0), ...
    scatter,1e3, ...
    'renderCov', false, ... Avoid from making the correlation matrix
    'CBS',false, ... Since we forward, the CBS is not necessary
    'uniformFirstScatter', false, ... For more efficient sampling
    'renderField', true, ... In order to actually render the image
    'parforIters', 12);
toc;

% put back the resolt into an image
u = reshape(mulres.field,pixNum,pixNum,lightsNum);

%% Plot the images
f = figure;
f.Position = [0,0,1400,250];

maxVal = max(abs(u(:)));

for lNum = 1:1:lightsNum
    subplot(1,lightsNum,lNum)
    imagesc(abs(u(:,:,lNum)),[0,maxVal]);
    
    colormap hot
    xticks([]);
    yticks([]);
    
    title([num2str(lights(lNum)),'\circ'])
end

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API