ucam-ceb-como / FlamePyrometry

Soot temperature and volume fraction from colour photographs
MIT License
6 stars 3 forks source link

it dont work with imageJ tif file #2

Open alphacellbox opened 1 year ago

alphacellbox commented 1 year ago

hey man... i am trying to use your code... i can run it with your example tif file and it gives me some results ...but i cant figure out how to make a proper tif file form my images...could u make an "step by step" tutorial with imageJ?...i mean from downloading an image from internet and make it ready and import it in code and get results...thanksssss

zhangw106 commented 1 year ago

you cannot download an image from the internet, you should get the raw flame image using your own camera.

alphacellbox commented 1 year ago

thanks for respond,,,,i have an image that contains raw flame and it is 66 frame and 100 MB with tif format...but when i wanna load it in your code it gives me this error....what part am i doing wrong?

//////////////////////////////////////////////////////////////// Finished loading image Traceback (most recent call last):

File "C:\Users\Cellbox\anaconda3\lib\site-packages\spyder_kernels\py3compat.py", line 356, in compat_exec exec(code, globals, locals)

File "c:\users\cellbox\desktop\flamepyrometry-master\flame_pyrometry.py", line 108, in [ImRed, ImGrn, ImBlu, ImDevRed, ImDevGrn, ImDevBlu] = Get_flame(filename, average, flame_height, HAB0, flame_width, plot_raw, thresh_tip, thresh_std, save_single)

File "C:\Users\Cellbox\Desktop\FlamePyrometry-master\Get_flame.py", line 48, in Get_flame ImDat[:,:,i,:] = ndimage.rotate((cv2.cvtColor(ImDatBayer[i,:,:], cv2.COLOR_BayerRG2RGB_EA)), degree, reshape=False)

error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\demosaicing.cpp:1721: error: (-215:Assertion failed) scn == 1 && (dcn == 3 || dcn == 4) in function 'cv::demosaicing' /////////////////////////////////////////////////////////////////

by th way i changed .COLOR_BayerRG2RGB to EA VRG and other but same error appears

jahdreyer commented 1 year ago

Hi,

It's hard to say what is causing this error without seeing the image you are trying to process. Is your image already a colour image (RGB) or grayscale with the Bayer pattern? If you already have a colour image, this demosaicing that cv2.cvtColor does is not required at all. Also note that you might get an error if the image is cropped before doing the demosaicing. I was using cv2.cvtColor to convert grayscale Bayer to RGB but you might not need it for your images.

Kind regards