Skip to content

Improve the package image fusion library.#6

Open
RichardTamarisk wants to merge 4 commits intomainfrom
develop_by_richard
Open

Improve the package image fusion library.#6
RichardTamarisk wants to merge 4 commits intomainfrom
develop_by_richard

Conversation

@RichardTamarisk
Copy link
Owner

  • Remove unnecessary comments in task.hpp and stitcher.cpp.
  • Update main(): The video frames decoded by ffmpeg are spliced.

* Update main(): The video frames decoded by ffmpeg are spliced.
@RichardTamarisk
Copy link
Owner Author

In this change, I add the image stitching wrapped function implementation stitcher.cpp, and successfully compiled the project, but the nothing in the SDL window after running the project.
Usage:

  • ./DisplayImage ../../fusion_fuc/img/left_1.jpg ../../fusion_fuc/img/right_1.jpg
    feedback:
    Task init! 0x561a80352cd0
    No more packet!
    No more packet!
  • ./DisplayImage ../img/left.mp4 ../img/right.mp4
    feedback:
    Task init! 0x644d7cc77cd0
    Segmentation fault (core dumped)

I was hoping you could take a look at this.

@JackLau1222
Copy link
Contributor

In this change, I add the image stitching wrapped function implementation stitcher.cpp, and successfully compiled the project, but the nothing in the SDL window after running the project. Usage:

  • ./DisplayImage ../../fusion_fuc/img/left_1.jpg ../../fusion_fuc/img/right_1.jpg
    feedback:
    Task init! 0x561a80352cd0
    No more packet!
    No more packet!
  • ./DisplayImage ../img/left.mp4 ../img/right.mp4
    feedback:
    Task init! 0x644d7cc77cd0
    Segmentation fault (core dumped)

I was hoping you could take a look at this.

I reviewed your code and have the following suggestions:

Please set is_corrected to false in the ImageFusion function, as the correct function is not robust enough. It doesn't handle some edge cases well, which leads to errors.
Also, do you really need to convert to the AV_PIX_FMT_BGR24 color format? On my Mac platform, this conversion is not accelerated, which causes errors. You might want to try it on your platform to see if it works properly.

The error log like this

[swscaler @ 0x1381f8000] No accelerated colorspace conversion found from yuv420p to bgr24.
[swscaler @ 0x1381f8000] bad src image pointers
sws_scale failed.
One or both input images are empty.

@RichardTamarisk
Copy link
Owner Author

The feature point detector I used before indicated that AV_PIX_FMT_BGR24 color space was required, so I changed to another detector. In my fusion_fuc, I conducted code test without any problem, whether is_correct is false or true is no problem.Usage:

cd ImageFusion/code/fusion_fuc
mkdir build
cd build
cmake ..
make
./DisplayImage ../img/left_1.jpg ../img/right_1.jpg

In addition, I also checked the number of detected features is normal.
image

@JackLau1222
Copy link
Contributor

JackLau1222 commented Nov 29, 2024

The feature point detector I used before indicated that AV_PIX_FMT_BGR24 color space was required, so I changed to another detector. In my fusion_fuc, I conducted code test without any problem, whether is_correct is false or true is no problem.Usage:

cd ImageFusion/code/fusion_fuc
mkdir build
cd build
cmake ..
make
./DisplayImage ../img/left_1.jpg ../img/right_1.jpg

In addition, I also checked the number of detected features is normal. image

you don't understand what i mean. i don't want to waste time to argue the code design here. it's not the point of this problem.

first, i need you disable the correct in player.
second, i need you test the code in your platform to check if it work?

@JackLau1222
Copy link
Contributor

what i want to tell you is the demo is not represent anything, you just pass simple scenario. the code can't handle any situation.

if you don't understand this, the project will be no useful.

@RichardTamarisk
Copy link
Owner Author

The feature point detector I used before indicated that AV_PIX_FMT_BGR24 color space was required, so I changed to another detector. In my fusion_fuc, I conducted code test without any problem, whether is_correct is false or true is no problem.Usage:

cd ImageFusion/code/fusion_fuc
mkdir build
cd build
cmake ..
make
./DisplayImage ../img/left_1.jpg ../img/right_1.jpg

In addition, I also checked the number of detected features is normal. image

The feature point detector I used before indicated that AV_PIX_FMT_BGR24 color space was required, so I changed to another detector. In my fusion_fuc, I conducted code test without any problem, whether is_correct is false or true is no problem.Usage:

cd ImageFusion/code/fusion_fuc
mkdir build
cd build
cmake ..
make
./DisplayImage ../img/left_1.jpg ../img/right_1.jpg

In addition, I also checked the number of detected features is normal. image

you don't understand what i mean. i don't want to waste time to argue the code design here. it's not the point of this problem.

first, i need you disable the correct in player. second, i need you test the code in your platform to check if it work?

I am currently testing whether the code can be played normally is video_fusion_player code, and the errors we encountered are completely different, I have not encountered the problem that the image after feature point detection and conversion image is empty, I hope you can upload your current code.

@RichardTamarisk
Copy link
Owner Author

what i want to tell you is the demo is not represent anything, you just pass simple scenario. the code can't handle any situation.

if you don't understand this, the project will be no useful.

I'll solve this problem as soon as possible.

@JackLau1222
Copy link
Contributor

what i modified is just disable the correct_image. Just like what i commented

I reviewed your code and have the following suggestions:

Please set is_corrected to false in the ImageFusion function, as the correct function is not robust enough. It doesn't handle some edge cases well, which leads to errors.
Also, do you really need to convert to the AV_PIX_FMT_BGR24 color format? On my Mac platform, this conversion is not accelerated, which causes errors. You might want to try it on your platform to see if it works properly.

@JackLau1222
Copy link
Contributor

if you set is_corrected to false, you'll see what problem i encountered.

@RichardTamarisk
Copy link
Owner Author

In this change, I add the image stitching wrapped function implementation stitcher.cpp, and successfully compiled the project, but the nothing in the SDL window after running the project. Usage:

  • ./DisplayImage ../../fusion_fuc/img/left_1.jpg ../../fusion_fuc/img/right_1.jpg
    feedback:
    Task init! 0x561a80352cd0
    No more packet!
    No more packet!
  • ./DisplayImage ../img/left.mp4 ../img/right.mp4
    feedback:
    Task init! 0x644d7cc77cd0
    Segmentation fault (core dumped)

I was hoping you could take a look at this.

I reviewed your code and have the following suggestions:

Please set is_corrected to false in the ImageFusion function, as the correct function is not robust enough. It doesn't handle some edge cases well, which leads to errors. Also, do you really need to convert to the AV_PIX_FMT_BGR24 color format? On my Mac platform, this conversion is not accelerated, which causes errors. You might want to try it on your platform to see if it works properly.

The error log like this

[swscaler @ 0x1381f8000] No accelerated colorspace conversion found from yuv420p to bgr24.
[swscaler @ 0x1381f8000] bad src image pointers
sws_scale failed.
One or both input images are empty.

Yes, in image fusion processing, I need to convert to BGR24 to process the tree color channels.
I am currently working on converting the image to YUV420P after the image stitching process is finished.
Maybe you don't care what needs to be done in this process, but I wonder if it needs to be done this way?

@RichardTamarisk
Copy link
Owner Author

I improved the avframeToCvmat function for submission this time, and the converted cv::Mat format images can be splintered normally, but the AVFrame format images converted by cvmatToAvframe function are splintered. Could you please help me find out what is wrong.

@RichardTamarisk
Copy link
Owner Author

The resulting image is spliced after using avframeToCvmat:
image
Use cvmatToAvframe to convert the spliced image to avframe:
image

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