I don't have Adobe Photoshop and Publisher 2013 does not Export CMYK Images. I wanted to send an Image to be printed to an online printing service (flyeralarm). They required the image the to be a jpeg, tif or PDF with images in CMYK color space using the „ISO Coated v2 300 % (ECI)“ color profile.
How-I-fixed-it:
I found a couple of ways, how to convert my RGB jpeg image to CMYK colorspace:
1. Using GIMP
There's a plugin for the (great!) open source freeware GIMP (GNU Image Manipulation Program), which is called separate+ and can be found here. Download it and copy the required files to your GIMP Plug-Ins folder. You also need the ICC Color profiles, which can be downloaded from Adobe here. Copy the profiles to C:\Windows\System32\spool\drivers\Color
After that, GIMP color management allows you to select the desired Profile.
There's a much more detailed description here (in German).
2. Using the "convert" tool of ImageMagick
Install ImageMagick on your computer.
You also need the ICC Color profiles, which can be downloaded from Adobe here. Copy the profiles to C:\Windows\System32\spool\drivers\Color
Using the command line type
convert sourcefile.jpg -profile Path_to_color_profile.icc outputfile.jpg
or, if you want a PDF:
convert sourcefile.jpg -profile Path_to_color_profile.icc outputfile.pdf
The detailed description can be found here (in German).
3. There are online Services that do the conversion for you:
http://www.rgb2cmyk.org/
http://www.cmykconverter.com/
This blog is about problems i encountered in everyday life and how i fixed them or worked around them. Sometimes i also just post things to let people out there know about something i think it might be of interest for others than me....
Showing posts with label rgb image. Show all posts
Showing posts with label rgb image. Show all posts
Sunday, December 1, 2013
Thursday, June 20, 2013
Receive and display Kinect RGB and depth image from ROS using Matlab, rosjava and matlab_bridge interface
I was looking for a smart way (without having to compile much stuff on my own) on how to communicate with ROS from Matlab. I wanted to receive color and depth images published by a ROS node for the Microsoft Kinect camera and Display the Images on a Matlab GUI.
How-i-fixed-it:
Me and Google worked out together, how to get it done.
I used the ROS-Matlab Bridge created by Tingfan Wu at UCSD, which is based on rosjava. It can be downloaded under: https://code.google.com/p/mplab-ros-pkg/wiki/java_matlab_bridge.
The setup is described on the project page.
Next i did a svn checkout of the repository http://mplab-ros-pkg.googlecode.com/svn/trunk
The trunk has some updated files compared to the zip download dated 2012-10-23.
The project can either be used to run your own ROS master locally or to connect to another ROS master somewhere on the network. The HelloWorld.m example script is the point to start to make yourself familiar with the functionality of the software.
Based on this examples, i created my own script to subscribe to a kinect Images Publisher on my local network. I subsribed to the topics '/camera/rgb/image_color' and '/camera/depth/image_rect'.
I found the right hints on how to convert the sensor_msgs/Image message data to MATLAB Images here: https://alliance.seas.upenn.edu/~meam620/wiki/index.php?n=Roslab.KinectMatlab, written by Ben Cohen. My implementation is a little different to theirs, but it was a good point to start.
Here's my final result:
jmb_init();
%MASTER_URI='http://localhost:11311';
%Set URI of the ROS master
MASTER_URI='http://i60p23:11311';
%Set the name of your node
NODE_NAME='Kinect_Listener';
%Init the node
node=jmb_init_node(NODE_NAME, MASTER_URI);
%Setup a logger
logger=node.getLog();
%Subscribe to the RGB and depth messages
sub_rgb=edu.ucsd.SubscriberAdapter(node,'/camera/rgb/image_color','sensor_msgs/Image');
sub_depth=edu.ucsd.SubscriberAdapter(node,'/camera/depth/image_rect','sensor_msgs/Image');
%Set the read timeout
timeout=5;
%Setup a figure to draw onto
close all;
rect = [100, 100, 320, 500]
figure('Position',rect);
%Two variables to calculate the fps
lastTime = 0;
fps = 0;
%Get 500 frames and draw the images on the figure
for frame = 1:500
%Get the RGB image
msg=sub_rgb.takeMessage(timeout);
if isempty(msg)
logger.warn('timeout');
else
%Read the timestamp
timeStamp = msg.header.stamp.toSeconds;
%logger.info(sprintf('I got rgb image %dx%d', msg.width, msg.height));
%Calculate the fps for frames > 0
if(frame == 1)
lastTime = timeStamp;
else
fps = 1/(timeStamp-lastTime);
lastTime = timeStamp;
end
%Convert data type
data = typecast(msg.data,'uint8');
%Re-Order the data into a matlab rgb array. The raw data has the
%format RGBRGBRGB.... beginning with the upper left image pixel
%(0,0). This format has to be converted to matlab format
img_rgb(:,:,1) = reshape(data(1:3:end),640,480);
img_rgb(:,:,2) = reshape(data(2:3:end),640,480);
img_rgb(:,:,3) = reshape(data(3:3:end),640,480);
%Flip the values
img_rgb = flipdim(img_rgb,2);
%Rotate the image 90 degrees
img_rgb_rot = imrotate(img_rgb,90);
%Plot the image
subplot(2,1,1);
imshow(img_rgb_rot); title(sprintf('Kinect: RGB (%d@%2.1f fps)',frame,fps),'FontSize',14,'FontWeight','Bold');
drawnow;
end
%Get the depth image
msg=sub_depth.takeMessage(timeout);
if isempty(msg)
logger.warn('timeout');
else
%Re-Order the data into a matlab rgb array. The raw data has the
%format RGBRGBRGB.... beginning with the upper left image pixel
%(0,0). This format has to be converted to matlab format
img_depth = reshape(typecast(msg.data,'single'), msg.width, msg.height);
%Flip the values
img_depth = flipdim(img_depth,2);
%Rotate the image 90 degrees
img_depth_rot = imrotate(img_depth,90);
%Plot the image
subplot(2,1,2);
imagesc(img_depth_rot./max(img_depth_rot(:))); title(sprintf('Kinect: Depth'),'FontSize',14,'FontWeight','Bold');
drawnow;
end
end
node.shutdown()
My System configuration:
Windows 8 Enterprise 64 Bit
Matlab 2013a 64 Bit
guava-13.0.1.jar
How-i-fixed-it:
Me and Google worked out together, how to get it done.
I used the ROS-Matlab Bridge created by Tingfan Wu at UCSD, which is based on rosjava. It can be downloaded under: https://code.google.com/p/mplab-ros-pkg/wiki/java_matlab_bridge.
The setup is described on the project page.
Next i did a svn checkout of the repository http://mplab-ros-pkg.googlecode.com/svn/trunk
The trunk has some updated files compared to the zip download dated 2012-10-23.
The project can either be used to run your own ROS master locally or to connect to another ROS master somewhere on the network. The HelloWorld.m example script is the point to start to make yourself familiar with the functionality of the software.
Based on this examples, i created my own script to subscribe to a kinect Images Publisher on my local network. I subsribed to the topics '/camera/rgb/image_color' and '/camera/depth/image_rect'.
I found the right hints on how to convert the sensor_msgs/Image message data to MATLAB Images here: https://alliance.seas.upenn.edu/~meam620/wiki/index.php?n=Roslab.KinectMatlab, written by Ben Cohen. My implementation is a little different to theirs, but it was a good point to start.
Here's my final result:
Here's the MATLAB script:
%Init rosjava first
Some more info and connecting ROS and MATLAB can be found here: http://www.ros.org/wiki/groovy/Planning/MatlabMy System configuration:
Windows 8 Enterprise 64 Bit
Matlab 2013a 64 Bit
guava-13.0.1.jar
Subscribe to:
Posts (Atom)
