I have 2 sets pf pcd file, the data in them is similar in terms of number of points but still there is a huge difference between load time of the pcd file (8x more). Following lines show the same.
suraj#suraj:~/PCL_Project/Data$ pcl_viewer PCD/000000.pcd
The viewer window provides interactive commands; for help, press 'h' or 'H' from within the window.
> Loading PCD/000000.pcd [PCLVisualizer::setUseVbos] Has no effect when OpenGL version is ≥ 2
[done, 143 ms : 115385 points]
Available dimensions: x y z intensity
suraj#suraj:~/PCL_Project/Data$ pcl_viewer 0001/data1.pcd
The viewer window provides interactive commands; for help, press 'h' or 'H' from within the window.
> Loading 0001/data1.pcd [PCLVisualizer::setUseVbos] Has no effect when OpenGL version is ≥ 2
[done, 1210 ms : 121016 points]
Available dimensions: x y z intensity
I want to see the header of these files, how to print the header information of a pcd file?
Of all the articles I searched which gave info of PCD file header and data, none of them said how to display the contents.
After trying multiple editors(gedit, visual studio editor, etc) I was able to display the contents of the file using Notepad++.
The only difference between the header of both files is the DATA tag which tells the data type in which the actual point cloud data is saved. The file which is read faster has data type as binary and the slower one has data type as ASCII.
I converted the ASCII file to Binary and then read it again, the speed is now increased as shown below.
suraj#suraj:~/PCL_Project/Data$ pcl_viewer 000000.pcd
The viewer window provides interactive commands; for help, press 'h' or 'H' from within the window.
> Loading 000000.pcd [PCLVisualizer::setUseVbos] Has no effect when OpenGL version is ≥ 2
[done, 160 ms : 115385 points]
Available dimensions: x y z intensity
suraj#suraj:~/PCL_Project/Data$ pcl_viewer data1.pcd
The viewer window provides interactive commands; for help, press 'h' or 'H' from within the window.
> Loading data1.pcd [PCLVisualizer::setUseVbos] Has no effect when OpenGL version is ≥ 2
[done, 147 ms : 121016 points]
Available dimensions: x y z
Related
Standard input and output are connected to a terminal that implements ANSI escape sequences, but is of unknown dimensions.
I need to know how big the terminal so to facilitate drawing a full-screen text UI on it. How can I get the size?
The correct size is not loaded into environment variables. I cannot use TIOCGETS; the the call would return success but the values are not correct -- the kernel doesn't know the size either.
There are lots and lots of answers searching stackoverflow, but they all depend on the OS providing the answer one way or anther; but this time that is not true.
The best clue I can find is the DSR command which returns the current cursor position; but there's no move to bottom/right command.
The resize program does this by moving the cursor to a very large column and row; the terminal moves as far as it can, e.g.,
CUP 999 999
Then resize asks where the cursor is:
DSR 6
The terminal replies with the actual cursor position (i.e., the cursor position report CPR), from which resize knows the terminal's size: the cursor is on the lower-right corner.
That's all done using standard (ECMA-48 / VT100) escape sequences. In XTerm Control Sequences (which should apply to your "ANSI" terminal)
CSI Ps n Device Status Report (DSR).
Ps = 6 -> Report Cursor Position (CPR) [row;column].
Result is CSI r ; c R
Today I encountered one weird bug in Chrome's printing behavior.
When I try to print a dynamically created PDF using Chrome (also in Firefox), every image inside the PDF gets a little bit smaller (8mm).
This doesn't happen neither in Adobe Reader/Acrobat/MacOSX Default Printer Dialog.
Let me explain more about my code so far:
dynamic PDF:
I use prawn to dynamically create a PDF A4 (landscape format) using this code:
require 'prawn'
require "prawn/measurement_extensions"
class CustomPdf < Prawn::Document
def initialize(label) # A4
super({
:page_size => "A4",
:page_layout => :landscape,
:margin => 0,
:print_scaling => :none})
image "my_image.png", :width => 213.mm, :at => [3.mm, 3.mm]
end
end
nested image inside the PDF:
The Image nested inside the PDF has a size of 213mm x 70mm with
300 DPI. In Pixel: 2515x827.
I create the Image using RMagick but the size, dpi and everything so far seems to be alright. So no further explanation at the moment.
Expected result:
The printed PDF will show an image with 213cm width.
Actual result:
The printed PDF will show an image with 205mm width.
What I tried so far
Setting the prawn page_size to something lower than A4 (since the Image isn't bigger as A4 as well...).
Playing around with print_scaling(there are 3 modes, :none, :AppDefault, :something_except_the_other_ones (Read more about it here)
Giving the image a fixed height (70mm)
Playing around with various settings provided by the Chrome Printer Dialog
Tested under Windows Chrome (it's 213mm there, weird), maybe it's related to MacOSX Chrome?
Tested under IE11 (205mm) unfortunately.
Neither of these did anything.
I looked through the Bugreporters of Chromium and found 2 people who might share the same problem as I do:
https://code.google.com/p/chromium/issues/detail?id=97972
https://code.google.com/p/chromium/issues/detail?id=67091
The last one was touched 2013 but no one said anything that actually worked for my case.
Examples
Here is an example 300 DPI image which width is 2515 px:
If Imgur changes the resolution to 72, you can pull the example image from the repository (link: https://github.com/posixpascal/chrome-printing-bug/blob/master/example.png)
Here is an example PDF
Direct Link: Direct Link
GitHub PDF Viewer: https://github.com/posixpascal/chrome-printing-bug/blob/master/output.pdf
Github Repository with example image & pdf generator script
https://github.com/posixpascal/chrome-printing-bug
Unfortunately I can't change the width of the image (not even a pixel).
Someone experienced the same problem?
Any ideas? It's an interesting puzzle I guess... :x
When I print a plain image or a website with Chrome there is a 'Use Original Size' or '100% size' option which I don't have when printing the PDF.
I also tried making a webpage instead of a PDF and set the image width to 213mm which didn't work either...
This is my test results from what i have seen by using a windows system and a Mac ( Yosemite )
Windows :
Printed the PDF in Chome : Perfect - 213 mm
Printed in IE : Perfect - 213 mm. This was less before ( around 205-210ish ). So changed the default print settings :
Selected the Print option -> Used Print Dialog -> Selected the printer -> Print Preferences -> Advanced -> Paper Size -> Changed scaling manually -> tested A4, A5 and so on.-> A5 ( for some reason gave me 213 )
So i moved onto the Mac.
Mac Findings:
Changed Paper Size and tested the same : Size was 213 mm.
This was done like this : Apple Print
So naturally, i tested printing it through Chrome directly instead of opening the PDF through OSX -> Printed at 205 mm.
Tested with printscaling on prawn at :appdefault -> Printed at 213 mm.
Tested the same on Firefox -> lower than 205 - 210 mm.
So i dont really know if its a Chrome issue because its acting weird on Firefox for me.
So ultimately, these are my findings after testing out the code on my end.
I experienced a similar 8 mm shrinkage using Chrome on Windows. Checked all my printer properties and settings and couldn't find what could be doing it. Turns out, I had the option "fit to page" ticked in the Chrome printing (ctrl+p) screen. Un-ticked it and reprinted a page, compared their widths and they were 8 mm off. Sometimes it's the simple things...
In my experience, Chrome prints html usually smaller. It may have to do with WebKit engine having "smart shrinking" feature. I have come across to it here (text search shrinkage). Or, it might be just that, Chrome developers gave it a little tweak since people in the past complained that the stuff does not fit the print.
I'm using the ZPL - Zebra Programming Language to format a Code 93 barcode ^BA to reside within a label.
I know I can set the default module width using ^BY. My problem is that ^BY1 makes the barcode to small to read and ^BY2 makes it too large for the label.
This is the code:
^FO15,110^BY2,3,35^BAN,35,N^FD001EC0A688E2^FS
I wish I could use decimal values with ^BY but that doesn't seem to be possible.
Some barcodes as Code 128 ^BC have a mode parameter to pack the bar code better based on the data but ^BA doesn't have that.
I saw that some barcodes as QR (^BQ) do have a magnification factor parameter but that's also missing for ^BA.
Are there any other ways to set the width with smaller steps than ^BY?
The label is 38 mm wide and 19 mm tall and the DPI is 203 (8 dots/mm) and the data is always 12 hexadecimal characters [0-9 and A-F].
^BY does allow decimals in the second parameter (2.0 to 3.0) but that only applies to variable-ratio barcodes and code-93 is fixed-ratio.
The problem is that you need to think in terms of dots. Setting the narrow-bar width to 2 (as in ^BY2) means that the wide bar is then 4 or 6 dots (^BY2,2 or ^BY2,3) so the physical result is that the data content is always going to be (3 bars + 3 spaces)*datalength which translates to a particular number of dots.
The dot pitch is commonly 203dpi but 300dpi are available (you don't say which model you are using.) The barcode width when printed thus depends dirctly onthe amount of data and barcode type you are using. It's not like laser-printers where 1200dpi is common - the dots are six times bigger.
So - you'd need to say how wide you can handle, which model you are using and what your data characteristics are (your sample shows 12-character hexadecimal - are you using full ASCII or could you adjust and use numeric-only?) Are you stuck on code-93 or will some other encoding be OK?
Have you tried ^BY2,2? That will use a smaller ratio, but larger base.
If you want a more detailed answer you will need to provide: DPI, print width and max amount of data you are trying to encode.
My goal is to be able to modify a Matrix screensaver that is no longer being supported by the developers. I simply want to be able to change the color of the glyphs from green to red. From what I've read, I might need to edit the compiled .nib file. And supposedly, there are tricks to do this.
The only files I see within the .saver file are:
Unix Executable File
InfoPlist.strings
Matrix.nib
a Glyphs.png (its in grayscale, so the color affect must come from programming)
A Matrix.nib file in a folder entitled Japanese.lproj
I don't see any other files that I could edit that would let me achieve this, so I am looking for some guidance.
EDIT: The author posted the source code for his screensaver on his github. Now i'm just trying to figure out exactly what needs to be changed.
The modification of the source code isn't very hard. The colors are computed on the fly, so an asset can't be modified to change the color.
In line 226 of MatrixStrip.m change the 1 before the left bracket to a 0. In Line 228 Change the 0 to a 1. The column below the V in the code.
.... V
226: colorArray[16*i + 4*c + 0] = (cellState[i] == 0) ? 0.0 : g;
227: // Cells which are very bright are slightly whitened
228: colorArray[16*i + 4*c + 1] = ((g > 0.7) && (cellState[i] != 0)) ? (g - 0.6) : 0.0;
Make the same change to lines 253 and 255. You are putting the numbers in column column 34 in the inner loops in order. In the original code, reading down column 34 the numbers a 1, 0, 2, 3. This has to be done in both of the inner loops on the 4 lines I indicated. These numbers are the indices to the RGBA color.
I'm not sure if my explanation is adequate, so instead of expanding this to 1000 words, I'll include a screen shot of the diff with the relevant parts highlighted by Kaleidoscope. The original code is on the left.
I had to download the image to see the relevant details.
I am developing an OpenGL application that has two working modes: windowed mode and full screen.
The app displays several graphic objects using OpenGL and writes some text strings using that same API. The program displays the texts strings in its intended positions when running as a windowed application, but when running full screen the text strings are displayed in an upper position that its intended position.
The app creates the fonts using wglUseFontBitmap and displays the text strings with glCallLists (it sets the text position using glRasterPos2i). Before the text is displayed I adjust the text position adding an offset to the Y coord. I get that offset using the GetDCOrgEx Win32 API call.
I think you have to call GetDCOrgEx again after getting in fullscreen mode, or do you already do this? It would help if you could post the code where you call GetDCOrgEx and calculate the Y offset.
EDIT: Another idea: Could it be that you can use the same Y offset, but negative? Or perhaps calculate Y position and then use height-ypos? There's some source code here that uses glRasterPos2i different when in fullScreen:
if(!state->fullScreen)
// if fullScreen (don't forget the image/GL y-coord vertical flip)
glRasterPos2i((w - state->img->cols())/2, (h - state->img->rows())/2);
else
// for non-fullscreen images
glRasterPos2i(0,h);
Schnaader, thanks a lot for your answers.
I have solved the problem modifying how I calculate the offset that I need to add to the Y coord. Now the offset is calculated with the following code:
m_iYOffset = GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYBORDER);
The above code solves the problem for my application.
Here's the code to calculate the Y offset:
POINT vOffset;
m_hdc = GetDC(m_hWnd);
if (m_hdc)
{
GetDCOrgEx(m_hdc, &vOffset);
m_iYOffset = vOffset.y;
}
The above code is called once the program has set up full screen mode. I tried to call GetDCOrgEx every time I need to write a text string, but the text is written at the same positions that when GetDCOrgEx is called only once.