How to detect teeth using opencv [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am working on one project and in that i want to make teeth white. So for that need to find teeth part.I have tried equalizeHist, adaptiveThreshold, threshold,dilate, erode etc.But not getting exact teeth part.
So can anyone tell me how can i do it.I am using OpenCV c++ library.
In input i have this image
I have found this type of mask
So if i use this mask the image looks unnatural like this,

I see two problems. You find the correct region, but the boundary is imprecise. That's solvable by looking at the gradient of the hue, which will form a clear contour. If you use the HSL color model, the Lightness component will likely have a sharp contrast too.
Secondly, the bigger effect IMO is that you far overdo the whitening. This loses a lot of contrast between teeth. You probably want to just drop the yellow saturation, but don't touch the luminosity.
If you want to be really fancy, determine where the teeth edges are, and you can smooth out the luminosity elsewhere. This removes small stains on teeth.

Related

How to segment the actual human body shape from an image? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
As per my requirement, from single image of a dressed human (say wearing pant and shirt) with clear and plain background, Which algorithm can draw outline of an human body shape for only the pose given in the image. I am using opencv c++ library. All I can hear for now, is grabcut and contours but they only draw outline around the outfit but I need outline around inside body shape after eliminating outfit. Any algorithm to achieve this?
There are many examples in internet,generally speaking we often use the HOG descriptor to detect pedestrian you can search some information about
HOGDescriptor::setSVMDetector
HOGDescriptor::getDefaultPeopleDetector()
here is a simple sample code about you request:
enter link description here

Draw a matrix of numbers as an image with C++ [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a quite specific question: I want to draw a matrix of numbers in a greyscale image. The higher the number the brighter the output. Is there a way to do that in a C++ programme without having dependencies to a graphic library like Qt?
I looked through some examples of ImageMagick, but I'm not sure how to implement its functions in C++.
Answer
In case someone stumbles upon this question:
a modified code of the example shown here was a handy and easy solution
It's hard without a library. SFML seems easy to use.
EDIT
Also you have 3 other questions hidden in your question:
1- To save an image you can use sf::image::saveToFile
2- To get brighter number for higher number: You need to normalize your numbers to [MinColorYouWant MaxColorYouWant] (for example: [128,255]). Thus the normalization value corresponding to each number will become the color of the number.
3- SFML uses RGBA images by default. Just set the RGB channels equal to make it look greyscale.
EDIT 2 : I've fixed the example normalization from [128,256] to [128,255].

reading black and white pixels as an array from jpeg in c and c++ [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
im trying to learn how to read a jpeg image as an array of pixels in c++ or c. so far ive learned that i have to include a outside library such as libjpg.h.
ive been told that the jpeg is formated in a RGB structure where each pixel gives 3 values. is this true? and if so how would i read values for a purely black and white image?
the purpose of this question is that i am trying to assign a pointer to the top right corner of a white squre in a black picture.
if someone could show me how to read out the vaules that are given to me for this situation so i could assign this pointer i would be greatful.
Let's suppose you run with libjpeg. You'll allocate a buffer and then call jpeg_read_scanlines a sufficient number of times to get all of your decompressed image data into memory. You can read scanlines (rows) individually and reformat them as needed. If the image is grayscale, the RGB values will all be equal, so you can just read one of them.
Paul Bourke's site has some pretty good usage examples of libjpeg.

Using pixel colors for artificial neural networks [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to try and make a program that can identify pictures. Since I'm using the pixel colors as input, should I have 3 inputs for each pixel in the image? (RGB values)
Color images are normally defined by at least three channels: R(red), G(green) and B(blue). You may also have alpha and all sorts of other channels. So yes, for one pixel you will have 3 inputs.
You have to clarify what exactly "identify pictures" entails.
"Identify pictures" is a very vague term.
You might want to take a look at something like OpenCV for handling image data. Within that library, the Mat structure provides very transparent pixel storage and access.
As far as semantics go, the function doing the "identification" would ideally accept an image object as an input, as opposed to image channels.

Recognising Image Patches - Advice Needed [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am looking for advice on algorithms that would allow me to recognise an image patch of a hand. So given an image, I would like to extract patches that would belong to a hand (those will be positive patches). Everything else would be negative patches.
My target application is to distinguish a hand (of any hand shape) from other objects without using colour, by being able to identify if a patch belongs to a hand..
The figure below depicts what I have in mind,
The only problem with hands is that it can take any shape form. Are there any suggestions or algorithms to do the above?
Thank you in advance.
This is a very broad research topic, so you are unlikely to find any good example software available, but you are likely to find many research papers in this area, and if you are lucky then you might find some where the authors publish their code.
You've given a picture of a cat, so taking that as inspiration I did a quick search and found this paper from the Andrew Zisserman group at Oxford University. Another group to look into is that of Jitendra Malik at University of California at Berkeley who have an interest in this area using a combination of image segmentation and feature detection.
Depending on your motives search terms could include: deformable shape models, skin segmentation (although you say you don't want to use colour - why not?), object detection. The possibilities are numerous, and they are all current research topics throughout a number of computer vision communities.