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

SDK2.55.1 get wrong color frame size #12902

Open
pumpkin639 opened this issue May 7, 2024 · 2 comments
Open

SDK2.55.1 get wrong color frame size #12902

pumpkin639 opened this issue May 7, 2024 · 2 comments
Labels

Comments

@pumpkin639
Copy link

pumpkin639 commented May 7, 2024

  • Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):

  • All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)


Required Info
Camera Model { D455 }
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version { Linux (Ubuntu 20) }
Kernel Version (Linux Only) (e.g. 5.10.160)
Platform RK3588S
SDK Version { legacy / 2.55.1 }
Language {C++ }
Segment {others }

|

Issue Description

Here are my codes.

#include <librealsense2/rs.hpp> // Include RealSense Cross Platform API
#include <iostream>             // for cout
#include <opencv2/opencv.hpp>

// Hello RealSense example demonstrates the basics of connecting to a RealSense device
// and taking advantage of depth data
int main(int argc, char * argv[]) try
{
    // Create a Pipeline - this serves as a top-level API for streaming and processing frames

	int camera_w = 640;
	int camera_h = 480;
	int camera_fps = 30;
	rs2::config cfg = rs2::config();
	
	cfg.enable_stream(RS2_STREAM_COLOR, 
		camera_w,
		camera_h,
		RS2_FORMAT_RGB8, 
		camera_fps);
	cfg.enable_stream(RS2_STREAM_DEPTH, 
		camera_w,
		camera_h,
		RS2_FORMAT_Z16, 
		camera_fps);
    rs2::pipeline p;
    // Configure and start the pipeline
    p.start(cfg);
    while (true)
    {
        // Block program until frames arrive
        rs2::frameset frames = p.wait_for_frames();
       	rs2::frame color_frame = frames.get_color_frame();
	      cv::Mat color = cv::Mat(cv::Size(camera_w, camera_h), CV_8UC3, (void*)color_frame.get_data(), cv::Mat::AUTO_STEP);
        cv::imshow("tt",color);
        cv::waitKey(0);

    }

    return EXIT_SUCCESS;
}

Snipaste_2024-05-07_15-22-17
Snipaste_2024-05-07_15-22-42
Snipaste_2024-05-07_15-27-01

When I run the code, the images displayed are sometimes incorrectly sized.
But when I use sdk2.53.1, the results are correct.

@MartyG-RealSense
Copy link
Collaborator

Hi @pumpkin639 When you upgraded to librealsense SDK version 2.55.1, did you also update your camera firmware driver version to 5.16.0.1 please? This is the recommended firmware to use with 2.55.1. Using older firmwares instead of the recommended version could result in errors.

@MartyG-RealSense
Copy link
Collaborator

Hi @pumpkin639 Do you require further assistance with this case, please? Thanks!

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

No branches or pull requests

2 participants