Giter Site home page Giter Site logo

Error in raw2temp about thermimage HOT 3 CLOSED

gtatters avatar gtatters commented on May 29, 2024
Error in raw2temp

from thermimage.

Comments (3)

gtatters avatar gtatters commented on May 29, 2024

have you tried running the entire example in readFLIRJPG? What is pasted above is not enough for me to tell that you succeeded in creating all the variables required for raw2temp to work. You will need to populate some of these inputs yourself, which is facilitated with the example:

`

library(Thermimage)
imagefile<-paste0(system.file("extdata/IR_2412.jpg", package="Thermimage"))

cams<-flirsettings(imagefile, exiftool="installed", camvals="")
cams

Emissivity<-cams$Info$Emissivity # Image Saved Emissivity - should be ~0.95 or 0.96
ObjectEmissivity<-0.96 # Object Emissivity - should be ~0.95 or 0.96
dateOriginal<-cams$Dates$DateTimeOriginal
dateModif<- cams$Dates$FileModificationDateTime
PlanckR1<- cams$Info$PlanckR1 # Planck R1 constant for camera
PlanckB<- cams$Info$PlanckB # Planck B constant for camera
PlanckF<- cams$Info$PlanckF # Planck F constant for camera
PlanckO<- cams$Info$PlanckO # Planck O constant for camera
PlanckR2<- cams$Info$PlanckR2 # Planck R2 constant for camera
OD<- cams$Info$ObjectDistance # object distance in metres
FD<- cams$Info$FocusDistance # focus distance in metres
ReflT<- cams$Info$ReflectedApparentTemperature # Reflected apparent temperature
AtmosT<- cams$Info$AtmosphericTemperature # Atmospheric temperature
IRWinT<- cams$Info$IRWindowTemperature # IR Window Temperature
IRWinTran<- cams$Info$IRWindowTransmission # IR Window transparency
RH<- cams$Info$RelativeHumidity # Relative Humidity
h<- cams$Info$RawThermalImageHeight # sensor height (i.e. image height)
w<- cams$Info$RawThermalImageWidth # sensor width (i.e. image width)

img<-readflirJPG(imagefile)

imgr<-rotate270.matrix(img)

library(fields)
image.plot(imgr, useRaster=TRUE, col=ironbowpal)

temperature<-raw2temp(imgr,ObjectEmissivity,OD,ReflT,AtmosT,IRWinT,IRWinTran,RH,
PlanckR1,PlanckB,PlanckF,PlanckO,PlanckR2)
colnames(temperature)<-NULL
rownames(temperature)<-NULL

t<-temperature
image.plot(t, asp=h/w, bty="n", useRaster=TRUE, xaxt="n", yaxt="n", col=ironbowpal)

library(ggplot2)
library(reshape2)
d<-melt(temperature)

p<-ggplot(d, aes(Var1, Var2))+
geom_raster(aes(fill=value))+coord_fixed()+
scale_fill_gradientn(colours=ironbowpal)+
theme_void()+
theme(legend.key.height=unit(2, "cm"), legend.key.width=unit(0.5, "cm"))
p

from thermimage.

jsgutierr avatar jsgutierr commented on May 29, 2024

from thermimage.

gtatters avatar gtatters commented on May 29, 2024

no worries. It's good to ask.
My function coding isn't perfect.
Usually they are all working by default since I do populate with my camera's default values (danger for others since they will be completely wrong by default!).

Maybe there was a syntax error with IRT but I noticed my example has IRWinTran spelled out. That could be me being inconsistent between examples. Thanks for bringing it up. I might need to fix the help files!

from thermimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.