I am working on rate control algorithms in HEVC. I have a problem. Can any one help me with how can I find each frame of an input video in HEVC? (Because I need to work on each frame as a distinct image but I don't know in what variable in HEVC each input frame is stored an processed.)
To find new frame
Parse the input data as per HEVC draft (annex B) to find start of frame (start_code_prefix_one_3bytes ). This will give you new NAL units.
If you find VCL-NAL parse slice header and find value of first_slice_segment_in_pic_flag equal to 1 specifies that the slice segment is the first slice segment of the picture in decoding order.
Do same process until you will get next vcl nal containing first_slice_segment_in_pic_flag equal to 1. So this will indicate you this is the start of new or next frame.
Related
I am trying to figure out what is the raw data in Kinect V2? ... I know we can convert these raw data to meters and to gray color to represent the depth .... but what is the unit of these raw data ?
and why all the images that captured by Kinect are mirrored?
The raw values stored in the depth image are in millimeters. You can get the X and Y values using the pixel position along with the depth camera intrinsic parameters. If you want I could share a Matlab code that converts the depth image into X,Y,Z values.
Yes, the images are mirrored in Windows-SDK and in the "libfreenect2" which is a open source version of SDK. I couldn't get a solid answer why it is so, but you could look at the discussion available in the link.
There are different kinds of frame which can be captured through Kinect V2. Every raw data captured has a different unit. Like, for depth frame it is millimeters, for color it is RGB (0-255, 0-255, 0-255), for bodyFrames it is 0 or 1 ( having same resolution as depth frame, but can identify up-to a maximum number of human bodies at a time ) and etc.
Ref: https://developer.microsoft.com/en-us/windows/kinect
During some development work regarding HEVC I encountered a camera that streams its pictures in multiple NAL units. When analyzing the bitstream I noticed that there are 3 NAL units per picture. I noticed this with the first_slice_segment_in_pic_flag = 1 for the first NAL unit and first_slice_segment_in_pic_flag = 0 for the 2 following NAL units.
Is there any way of knowing how many NAL units make up a full picture or which NAL unit is the final one of the current picture without looking at the 4th NAL unit (the first one of the next picture)?
No its not possible. You get to know end of the picture after decoding last CTU of the picture or when you get the first slice of the next picture.
I am using a USRP to transmit BPSK modulated data. To modulate, I use a 80 000 elements vector (vector_source_c format) which I want to multiply with the data (vector_source_c as well) I'd like to send.
My problem is that the data is important, so I'm trying to multiply it by slices with my vector, using the block multiply_cc(). I'm affraid the ultiplication is made only between my modulation vector and the 80000 first elements of my datam then repeated.
Is it how multiply_cc() works ? If true, is there a block I can use to multiply and stream ?
I'm attempting to unpack bytes from an input file in GNU Radio Companion into a binary bitstream. My problem is that the Unpack K Bits block works at the same sample rate as the file source. So by the time the first bit of byte 1 is clocked out, byte 2 has already been loaded. How do I either slow down the file source or speed up the Unpack K Bits block? Is there a way I can tell GNU Radio Companion to repeat each byte from the file source 8 times?
Note that "after pack" is displaying 4 times as much data as "before pack".
My problem is that the Unpack K Bits block works at the same sample rate as the file source
No it doesn't. Unpack K Bits is an interpolator block. In your case the interpolation is 8. For every bytes 8 new bytes are produced.
The result is right, but the time scale of your sink is wrong. You have to change the sampling rate at the second GUI Time Sink to fit the true sampling rate of the flowgraph after the Unpack K Bits.
So instead of 32e3 it should be 8*32e3.
Manos' answer is very good, but I want to add to this:
This is a common misunderstanding for people that just got in touch with doing digital signal processing down at the sample layer:
GNU Radio doesn't have a notion of sampling rate itself. The term sampling rate is only used by certain blocks to e.g. calculate the period of a sine (in the case of the signal source: Period = f_signal/f_sample), or to calculate times or frequencies that are written on display axes (like in your case).
"Slowing down" means "making the computer process samples slower", but doesn't change the signal.
All you need to do is match what you want the displaying sink to show as time units with what you configure it to do.
I'm interested in extraction of transformation matrix from image coordinate to patient coordinate from DICOM header of a RTDOSE matrix.
I just have a RTDOSE as a single DICOM file.
When I get the imageorigin patient it seems that the origin for just the first slice is given.
How can I get the origin for the last slice?
(or maybe its better to said: I mean how can I extract this .dcm file to its separate slices?)
Any help will appreciated.
Zahra
Grid Frame Offset Vector (3004,000c) defines the offset (in mm) for each dose slice. Combining the Image Position (Patient) (0020,0032), and the offset for the last slice you can calculate the position of the last slice. Direction of the offset is perpendicular to the plane on which the dose has been defined.
More details in chapter C.8.8.3.2 in Part 3 of the DICOM standard.
http://medical.nema.org/medical/dicom/2014a/output/pdf/part03.pdf