Can I add certain colors to bar graphs in order to illustrate frequency of the data point on octave? - histogram

I would like to customize my histogram to show an array of colors that refer to the frequency of that value. Essentially, if there are 6 times a value appears I would like it to be bright red, vs 2 times a value appears it would be dark red. Is there a way to assign colors to each bar graph manually, or perhaps a way the program automatically assigns colors based on the frequency the data point appears.
I'm willing to also keep colorization of my graph to be similar to the color bar attached in the image below.
I haven't been able to find a walkthrough that details what I'm looking for. I am very green with the Octave app and am not great at navigating it without explicit instruction. Thank you for the help!

Related

How to check if boxes in an image have text in it?

I have a table similar to this where the text is actually handwritten. I want to be able to check if each field has been filled out but understanding or recognising what each field says is not necessary. I just need to be able to detect that the field has been filled out.
example of table
People will have to scan pages with a scanner and the program should detect the fields and check if they have any contents essentially. Does anyone have any ideas or know of simple solutions. I was thinking using ICR or OCR but OCR can't detect handwritten text and ICR is only good if you pay for it but it is too good.
This could be very easy but it depends on how static the situation is. Convert the image to a grayscale image then apply a threshold to separate black and white. Next you have to ignore the too small white regions that belong to letters like a or o and then apply a closing to the remaining regions to get the single table cells. Now you can determine the average gray value at the position of each region. If it is above a certain value, then you have found a cell that is filled in.
This method only works if the white background of a cell is somehow connected, otherwise the closing will not work as desired. The lighting situation is also critical with fixed threshold values.

Know algorithms to change the colour of a product

My question might be off topic, but I didn't a better forum to ask.
I need to change the color of a product on an eCommerce website. We have many styles and many colours, so taking a picture of every combination is out of question (about 100 styles and colours, which will result in 10,000 pictures. We just don't have time to take that many pictures or process them manually). However, I could take a picture of every product and and a picture of one style in every colours and then make a program which generate all the missing pictures. I was thinking using something like OpenCV (and probably python) which provide lots classic computer vision algorithm off the shelf, to do so. Before doing it, I'm sure this is a classic image processin problem. Does it have a name or is there any algorithm or resources on the topic ?
In other world, there are apps and program which allows you to change the colour of our dress or clothes. Does any body knows how it works or have usefull resources related to this problem ?
You separate intesity from colour information. Then you change the colour information and merge both back together.
This will give you an image with changed colours but maintained brightness. So shadows, highlights and so on stay untouched.
You have to convert your RGB touples to a colour space that has separate coordinates for intensity and colour.
https://en.wikipedia.org/wiki/Lab_color_space as one example
Of course you may restrict these operations to your "product" so anything else remains unchanged.

Fake colors through camera

in an iOS application I need to recognize colors through camera, but analyzing the problem, I noticed that different kinds of light make the colors observed in the captured picture a little bit different from the real ones. For example, under a high neon light a light blue seems like a gray.
What is the cause and what kind of approch I could follow to solve this problem of "fake colors"?
The colors are not fake, they are just different than what you expect them to be. As #Piglet said this has a lot to do with the physics of light and white balance may help.
If you want to read more about it look at:
Color Rendering Index
Color Metamerism
Sensitivity Metamerism Index
Color Constancy
These all refer to the physics behind why different illuminations create different colors. There is also the camera color pipeline that contributes its share, so you can also read about white balance and tone mapping...

replacing an existing color by a new one in an image with iOS

Let's say I have an image with a few colors.
I would like to replace programmatically a specific existing color by a new one.
(something simple, no need to support gradients, like I saw elsewhere).
E.g. I have an image showing a green circle and I want to display it as a red circle (every pixel initially defined with a given (R,G,B) is now displayed with a new (R,G,B).
Any idea of how to do that with the Apple ios SDK ? (or open source ...)
And btw what would be the best image file format to make this easier (png, jpg ....) ?
Thanks !
You should be able to do this using Core Image filters. the Color Cube CI filter lets you map a source color range to destination colors. You should be able to define a source color range and map it to different colors.
That's one CI Filter I didn't figure out how to use however. If you do a search on "Color Cube" in the Xcode help system there is sample code that does a "chromakey" effect that knocks out green shades to transparent. You should be able to adapt that to your needs.
I have a project on Github called CIFilterTest that shows how to use Core Image filters to process images. It's written as a general-purpose system that lets you try a wide variety of filters that use a standard set of parameters (points, colors, 1 or 2 source images, and floating-point values.) I never did take the time to generate the 3D color mapping "cube" that the color cube filter needs as input, so it doesn't allow you to use that particular filter. You'll have to look at the color Cube sample code in the Xcode docs to generate inputs for the Color Cube filter, but my sample app should help a great deal with the basic setup for doing CI based image processing.
answered similar question here:
Replace particular color of image in iOS
in short: I would suggest using CoreImage filter.

I have hand-drawn some work on grid paper and scanned it, how can I use Photoshop to remove the gridlines

The grid is a blue/green. The work is in a black ink, and has a fair bit of variety of pressures, which I want to retain.
Here's a link to a small selection.
I have Photoshop v3
My attempts have involved using Select, Color Range, and sampling some grid, then inverting.
Is there a better way?
I also have some experience with Python and PIL, if that's a useful alternative.
This is a Photoshop answer, rather than a programming answer, but that seems to match your question's needs.
I applied a Black and White filter, and enabled a Blue filter, then set the Blue channel sensitivity to 300%, like this in Photoshop CC.
and got pretty good results like this:
In an older vsersion of Photoshop, you may need to go to Image->Mode->Lab Color and then go into the Channels palette and deselect Lab leaving just a and b channels selected, then use Select->Color Range to get the blues (or maybe the blacks!!!!) before going back to RGB mode.

Resources