Matlab stuff

From SoftwareGuy
Jump to navigation Jump to search

Matlab/Octave tools[edit | edit source]

Run a script and plot the results[edit | edit source]

i=imread(strcat(num=num2str(system('../pull-last.sh')), '.orig.tiff'));plot(mean(i));title(num);
#!/bin/bash

#otlf scanid 6340-6344, photoid 5820-5824, lprid 2911-2912

ip=192.168.1.9

wget -qO heartbeat http://$ip/heartbeat
id=$(jq '.lastVehicleRecord.scans[].id' heartbeat)

wget -qO $id.orig.tiff http://$ip/requestImage/?scanId=$id
#wget -O $id.modified-orig.tiff "http://$ip/requestImage/?scanId=$id&format=modified%22
rm heartbeat

#echo $id

exit $id

Scale one raster, lab system[edit | edit source]

i(1:3:882,:) = i(1:3:882,:)*.93;

or

i(1:3:size(i)(1),:) = i(1:3:size(i)(1),:)*.93;
i(1:3:end,:) = i(1:3:end,:)*.93;

pull-last.sh script[edit | edit source]

!/bin/bash                                                                     
#otlf scanid 6340-6344, photoid 5820-5824, lprid 2911-2912                      

ip=192.168.1.9
wget -qO heartbeat http://$ip/heartbeat
id=$(jq '.lastVehicleRecord.scans[].id' heartbeat)

wget -qO $id.orig.tiff http://$ip/requestImage/?scanId=$id
#wget -O $id.modified-orig.tiff "http://$ip/requestImage/?scanId=$id&format=modified%22                                                                          
rm heartbeat
echo $id

#exit $id                                                                       


Read in file and plot histogram of image scan[edit | edit source]

[stat, num] = system("../../pull-last.sh");num=strtrim(num);i=imread([num ".orig.tiff"]);plot(mean(i));title(num);