octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overlay an image with an Array of Data.


From: JulesVerne
Subject: Re: Overlay an image with an Array of Data.
Date: Thu, 28 Apr 2016 22:46:38 -0700 (PDT)

I solved my problem, it is not really a nice job but it worked.

## Copyright (C) 2016 Dominik Löwenstein
## 
## This program is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
## 
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.

## -*- texinfo -*- 
## @deftypefn {Function File} address@hidden =} overlayImg (@var{input1},
@var{input2})
##
## @seealso{}
## @end deftypefn

## Author: Dominik Löwenstein <address@hidden>
## Created: 2016-04-29

function   overlayImg (array,picture="default.jpg")
  
  
  pic=imread(picture);    %load picture
  N=size(pic);            %get size of rows
  [pic,map]=rgb2ind(pic); %convert to ind and back to get double instead od
uint8
  pic=ind2rgb(pic,map);
  array=uint8(round(mat2gray(array)*254+1));  %create gray indexed image 
  array=ind2rgb(array,jet(256));              %get colored image
  array=imresize(array,[N(1),N(2)]);          %get same size of images
  overlay=imadd(pic,array);                   %combine image and array
  imshow(overlay);                            %show new image
  
endfunction




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Overlay-an-image-with-an-Array-of-Data-tp4676573p4676601.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]