Skip to content

Conversation

@csabaerdei
Copy link

No description provided.

@artyom-beilis
Copy link
Owner

Ok wait a second - lets go one by one.

1st Tint is seems to what is called wb - it defined as temperature - so no need a new parameter. There is a WB as gains and WB as temperature - so no need to create a new one
2nd. Regarding byte order.

Do you have issues with rgb24 or raw16 as well? Can you please check (with existing version without your PR) what happens when to capture MacBethColor checker are colors swapped in rgb24? are colors swapped in raw16?

I explain. I don't have color touptek camera but color ZWO camera that works well.
I strongly suspect that RGB24 format of ZWO for some reason actually BGR24...

Now what happens that zwo works 100% ok.

Now regarding byte order, if it is raw - and there is an error that the error is in providing correct codes for bayer patters at touptek driver level otherwise no need to change at video generator/etc level.

So what conserns me is that I don't swap rgb24 to bgr24 by mistake and it happens on zwo ok because they send bgr24 in first place.

Please attach the images of original code version of MacBeth color checker in rgb24 and raw16 formats.

It may be way more localised fix. (probably at driver level to swap rgb2bgr in rgb mode and fix bayer pattern order)

@artyom-beilis
Copy link
Owner

Ok I checked zwo driver in indi and it indeed swaps r/b order: https://github.com/indilib/indi-3rdparty/blob/master/indi-asi/asi_base.cpp#L93

So it means it works for zwo "by-mistake" and

So I suggest for RGB24 format in case of touptek swap r/b and driver level and it would be way simpler solution, and if it is raw16 and it does not work well fix the bayer pattern settings...

Lets continue the follow up

@csabaerdei
Copy link
Author

1st - My observation is that tint has a different effect in the manufacturer provided ToupLite program than wb, so it is not bad to have it adjustable.

2nd - Both RAW16 and RGB24 are impacted.

It may be way more localised fix. (probably at driver level to swap rgb2bgr in rgb mode and fix bayer pattern order) -

Agree, for RGB Toupcam has an option to read frame as BGR, I tried and it works, but thought that it puts some load to hardware or can be less optimized than converting with opencv, so that is why I did the conversion after. I will put back it to code. For RAW this setting is not applicable, I use an if condition and the correct Bayer conversion parameters for RGB. So no extra conversion done there.

I do suspect that the problem of color swap lies in usage of cv::Mat, it works correctly with BGR default cameras and BGR buffer, but not with RGB. As far as I see there is no option to change this behavior.

I will try MacBeth and/or provide an evidence of color swap with the unmodified code.

Btw. can you provide me some guidance how to build the project for Android? It would be at least helpful to me to avoid shooting blue images of Mars and Great Blue Spot of Jupiter.

Thanks in advance.

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

Successfully merging this pull request may close these issues.

2 participants