Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it dont work with imageJ tif file #2

Open
alphacellbox opened this issue Dec 27, 2022 · 3 comments
Open

it dont work with imageJ tif file #2

alphacellbox opened this issue Dec 27, 2022 · 3 comments

Comments

@alphacellbox
Copy link

alphacellbox commented Dec 27, 2022

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
Copy link
Contributor

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

@alphacellbox
Copy link
Author

alphacellbox commented Dec 29, 2022

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
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants