Mes: julio 2016

JunoCam – RGB channel merged.

The following picture shows the result of merge 16 sequencial frames

merged_frame

%
% This script show how to load a .IMG raw data file and merge the color channel 
% in order to get a real color image.
%
% javierluiso@gmail.com
% 2016.06.28

function Example_merge_frames()

% The PDS Header is parsed
pds_header = readPDSHeader('JNCE_2013282_00C102_V01.LBL');

% The IMG file is loaded.
raw_data = loadIMGfile(pds_header);
[R, G, B] = separateRGBframelets(raw_data');
[RGBFrames] = buildRGBFrames(R,G,B);

% Get dimenson for further use
[rows, cols, colors, total_frame] = size(RGBFrames);


TOTAL_FRAMES = 16;
frames = zeros(rows,cols, colors, TOTAL_FRAMES); 

for f=1:TOTAL_FRAMES
 frames(:,:,:,f) = RGBFrames(:,:,:,f)./255;
endfor

merged_frame = mergeChannels(frames, 115);
figure();
imshow(merged_frame);
title("Result of the merge process applide to N sequencial frames\n 115 pixel overlaping");

imwrite(merged_frame, "merged_frame.png");

endfunction;

 

Anuncios

JunoCam – PDS

Understanding .IMG and .LBL files.

Imaging data is available on the Internet for most NASA planetary missions that have been flown since the early 1970s

During the 1980s, the Planetary Data System established standards governing the format of image data delivered to the PDS.  Later missions conformed to that format standard, and the PDS provides online software enabling users to download data from the PDS archives and convert it into other useful data formats. PDS formatted images usually have a .IMG file extension and have detached ASCII-formatted text labels containing the image’s metadata, in a .LBL file.

JunoCam data will provided in PDS format. Indeed all the Earth Flyby data is available here.

A first version of .LBL file parser  is now available to process .IMG raw data files.

PDSHeader = readPDSHeader(lbl_file_name);

The next example shows how to use them:

%
% This script show how to load a .IMG raw data file.
% The .lbl file contains all information related to .img file data and how to parse it.
% This example read the PDS header from de .lbl file
% With all de information from PDS header the raw data is loaded en then all data is processed/
% In this example de RGB channels will be separated and then each frame of the camera sequence will be composite
% and save as a .png file.
%
% javierluiso@gmail
% 2016.06.28
function Example_process_PDS_data(lbl_file)

pds_header = readPDSHeader(lbl_file);
raw_data = loadIMGfile(pds_header);

if ( (pds_header.filter.BLUE == 1) && 
     (pds_header.filter.RED == 1) && 
     (pds_header.filter.BLUE ==1) )

    [R, G, B] = separateRGBframelets(raw_data');
    [RGBFrames] = buildRGBFrames(R,G,B);
    saveRGBFrameSequence(RGBFrames);
endif;

endfunction;