You can convert a string to an integer by the std::stoi() function:
The function skips any potential whitespace and then takes as many characters as possible to form a valid number. This means the first number can be obtained through a simple call on the string:
int height = std::stoi( s ); // string s
However, the second call needs to start at the comma, and since you don't know beforehand where that is, you have to search for it through a call to find():
std::stoi() doesn't give you the option not to begin at the start, but the substr() method allows you to construct a string starting at a given position. Since the second number starts after the comma, we need to start parsing at the index of the comma incremented by one. The whole call to get the second number thus looks like this:
int width = std::stoi( s.substr( s.find( ',' ) + 1 ) );
You can then repeat this for the second input.